From: kkinnunen Date: Fri, 2 Jan 2015 15:24:14 +0000 (-0800) Subject: debugger: Move Skia initialization out of the GUI widget class X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~4221 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5caff917f5f217e3070762847e6934f714196afb;p=platform%2Fupstream%2FlibSkiaSharp.git debugger: Move Skia initialization out of the GUI widget class Move Skia initialization out of the GUI widget class to the main function. Before, Skia may have been already called before the SkGraphics::Init was run. Review URL: https://codereview.chromium.org/822583003 --- diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp index cb8ae10..1d37c7d 100644 --- a/debugger/QT/SkDebuggerGUI.cpp +++ b/debugger/QT/SkDebuggerGUI.cpp @@ -7,16 +7,12 @@ #include "SkDebuggerGUI.h" #include "SkForceLinking.h" -#include "SkGraphics.h" -#include "SkImageDecoder.h" #include #include "PictureRenderer.h" #include "SkPicturePlayback.h" #include "SkPictureRecord.h" #include "SkPictureData.h" -__SK_FORCE_IMAGE_DECODER_LINKING; - #if defined(SK_BUILD_FOR_WIN32) #include "SysTimer_windows.h" #elif defined(SK_BUILD_FOR_MAC) @@ -124,12 +120,6 @@ SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) : fMenuEdit.setDisabled(true); fMenuNavigate.setDisabled(true); fMenuView.setDisabled(true); - - SkGraphics::Init(); -} - -SkDebuggerGUI::~SkDebuggerGUI() { - SkGraphics::Term(); } void SkDebuggerGUI::actionBreakpoints() { diff --git a/debugger/QT/SkDebuggerGUI.h b/debugger/QT/SkDebuggerGUI.h index 695a858..6f6f647 100644 --- a/debugger/QT/SkDebuggerGUI.h +++ b/debugger/QT/SkDebuggerGUI.h @@ -56,8 +56,6 @@ public: */ SkDebuggerGUI(QWidget *parent = 0); - ~SkDebuggerGUI(); - /** Updates the directory widget with the latest directory path stored in the global class variable fPath. diff --git a/debugger/debuggermain.cpp b/debugger/debuggermain.cpp index d537d36..0aec02b 100644 --- a/debugger/debuggermain.cpp +++ b/debugger/debuggermain.cpp @@ -7,8 +7,13 @@ */ #include "SkDebuggerGUI.h" +#include "SkForceLinking.h" +#include "SkGraphics.h" #include +__SK_FORCE_IMAGE_DECODER_LINKING; + + static void usage(const char * argv0) { SkDebugf("%s \n", argv0); SkDebugf(" [--help|-h]: show this help message\n"); @@ -23,6 +28,7 @@ int main(int argc, char *argv[]) { // constuction. However, the components Qt calls (X11 libs, ..) will override that. setenv("LC_NUMERIC", "C", 1); #endif + SkGraphics::Init(); QApplication a(argc, argv); QStringList argList = a.arguments(); @@ -60,5 +66,7 @@ int main(int argc, char *argv[]) { } w.show(); - return a.exec(); + int result = a.exec(); + SkGraphics::Term(); + return result; }