diff options
author | kkinnunen <kkinnunen@nvidia.com> | 2015-01-02 07:24:14 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-02 07:24:14 -0800 |
commit | 5caff917f5f217e3070762847e6934f714196afb (patch) | |
tree | 57c13aaee89f7e683c33ff435308593d61652940 /debugger | |
parent | c4fda92f45b9649f233a5b8636618a6431aa59cb (diff) |
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
Diffstat (limited to 'debugger')
-rw-r--r-- | debugger/QT/SkDebuggerGUI.cpp | 10 | ||||
-rw-r--r-- | debugger/QT/SkDebuggerGUI.h | 2 | ||||
-rw-r--r-- | debugger/debuggermain.cpp | 10 |
3 files changed, 9 insertions, 13 deletions
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp index cb8ae1046e..1d37c7d76f 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 <QListWidgetItem> #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 695a8582b9..6f6f64769a 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 d537d363c9..0aec02b9b2 100644 --- a/debugger/debuggermain.cpp +++ b/debugger/debuggermain.cpp @@ -7,8 +7,13 @@ */ #include "SkDebuggerGUI.h" +#include "SkForceLinking.h" +#include "SkGraphics.h" #include <QApplication> +__SK_FORCE_IMAGE_DECODER_LINKING; + + static void usage(const char * argv0) { SkDebugf("%s <input> \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; } |