[aseprite] 68/196: Revert make use of aseprite thumbnail-generator"
Tobias Hansen
thansen at moszumanska.debian.org
Wed Apr 20 18:50:02 UTC 2016
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit 90b1c243b0f9dae0339bc496b8323b9cb00d2ae8
Author: Gabriel Rauter <rauter.gabriel at gmail.com>
Date: Tue Mar 15 14:32:05 2016 +0100
Revert make use of aseprite thumbnail-generator"
Revert to basic native behavior.
This reverts commit b64ba236d3cef5e1d45e79d9093855713af4e9dc.
---
src/she/CMakeLists.txt | 3 +--
src/she/gtk/native_dialogs.cpp | 38 +++-----------------------------------
2 files changed, 4 insertions(+), 37 deletions(-)
diff --git a/src/she/CMakeLists.txt b/src/she/CMakeLists.txt
index 8d9ade3..eddf386 100644
--- a/src/she/CMakeLists.txt
+++ b/src/she/CMakeLists.txt
@@ -222,6 +222,5 @@ endif()
if(WITH_GTK_FILE_DIALOG_SUPPORT)
target_link_libraries(she
- ${GTKMM_LIBRARIES}
- app-lib)
+ ${GTKMM_LIBRARIES})
endif()
diff --git a/src/she/gtk/native_dialogs.cpp b/src/she/gtk/native_dialogs.cpp
index 41f5fa2..37ce7b1 100644
--- a/src/she/gtk/native_dialogs.cpp
+++ b/src/she/gtk/native_dialogs.cpp
@@ -13,12 +13,8 @@
#include "she/gtk/native_dialogs.h"
-#include "app/thumbnail_generator.h"
-#include "app/file_system.h"
#include "base/string.h"
#include "she/display.h"
-#include "she/surface.h"
-#include "she/locked_surface.h"
#include "she/error.h"
#include <gtkmm/application.h>
@@ -32,6 +28,7 @@
#include <glibmm/fileutils.h>
#include <string>
+#include <map>
namespace she {
@@ -137,25 +134,8 @@ public:
this->set_preview_widget_active(false);
std::string fileName = this->get_filename();
try {
- if (!fileName.empty() && !Glib::file_test(fileName, Glib::FILE_TEST_IS_DIR)) {
- app::IFileItem* fileItem = app::FileSystemModule::instance()->getFileItemFromPath(fileName);
- app::ThumbnailGenerator* generator = app::ThumbnailGenerator::instance();
- generator->addWorkerToGenerateThumbnail(fileItem);
- while(generator->checkWorkers()){};
- she::LockedSurface* thumbnailSurface = fileItem->getThumbnail()->lock();
- she::SurfaceFormatData* formatData = new she::SurfaceFormatData();
- thumbnailSurface->getFormat(formatData);
- uint8_t* data = thumbnailSurface->getData(0, 0);
- auto tempPixbuf = Gdk::Pixbuf::create(Gdk::COLORSPACE_RGB,
- true,
- 8,
- thumbnailSurface->lockedWidth(),
- thumbnailSurface->lockedHeight());
- ConvertBetweenBGRAandRGBA(data, thumbnailSurface->lockedWidth(),
- thumbnailSurface->lockedHeight(), tempPixbuf->get_pixels());
- auto previewPixbuf = tempPixbuf->scale_simple(thumbnailSurface->lockedWidth() * 2,
- thumbnailSurface->lockedHeight() * 2,
- Gdk::INTERP_NEAREST);
+ if (!Glib::file_test(fileName, Glib::FILE_TEST_IS_DIR)) {
+ auto previewPixbuf = Gdk::Pixbuf::create_from_file(fileName, 256, 256, true);
m_preview.set(previewPixbuf);
this->set_preview_widget_active();
}
@@ -197,18 +177,6 @@ private:
Display* m_display;
bool m_cancel;
static std::string& lastUsedDir() { static std::string lastUsedDir; return lastUsedDir; }
- void ConvertBetweenBGRAandRGBA(uint8_t* input, int pixel_width, int pixel_height, uint8_t* output) {
- int offset = 0;
- for (int y = 0; y < pixel_height; y++) {
- for (int x = 0; x < pixel_width; x++) {
- output[offset] = input[offset + 2];
- output[offset + 1] = input[offset + 1];
- output[offset + 2] = input[offset];
- output[offset + 3] = input[offset + 3];
- offset += 4;
- }
- }
- }
};
NativeDialogsGTK3::NativeDialogsGTK3()
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list