Certain compilers in an effort to optimize code chop off files that are never
used. By adding a flag to common conditions and variables we can force skia to
recompile with global static initializers off. By making a call to
SkGraphics::Init we now register all those functions that had been previously
automatically excluded by the compiler.
Review URL: https://codereview.appspot.com/6443112
git-svn-id: http://skia.googlecode.com/svn/trunk@5057
2bbb7eff-a529-9590-31e7-
b0007b416f81
* found in the LICENSE file.
*/
-#include <iostream>
#include "SkDebuggerGUI.h"
+#include "SkGraphics.h"
#include <QListWidgetItem>
SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) :
fMenuEdit.setDisabled(true);
fMenuNavigate.setDisabled(true);
fMenuView.setDisabled(true);
+
+ SkGraphics::Init();
}
-SkDebuggerGUI::~SkDebuggerGUI() {}
+SkDebuggerGUI::~SkDebuggerGUI() {
+ SkGraphics::Term();
+}
void SkDebuggerGUI::actionBreakpoints() {
fBreakpointsActivated = !fBreakpointsActivated;
--- /dev/null
+# Used to recompile required skia libraries with static initializers turned
+# off. This fixes a bug in which the linux compiler was incorrectly stripping
+# required global static methods in an optimization effort.
+
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+CWD=$SCRIPT_DIR/../
+
+DEFINES="skia_static_initializers=0"
+export GYP_DEFINES="$DEFINES"
+
+make clean -C $CWD
+make -C $CWD debugger -j
# conditions used in both common.gypi and skia.gyp in chromium
#
{
+ 'defines': [
+ 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=<(skia_static_initializers)',
+ ],
'conditions' : [
['skia_gpu == 1',
{
},
],
- ['skia_os == "mac"',
+ ['skia_os == "mac"',
{
'defines': [
'SK_BUILD_FOR_MAC',
},
],
- ['skia_os == "ios"',
+ ['skia_os == "ios"',
{
'defines': [
'SK_BUILD_FOR_IOS',
},
},
],
-
- ['skia_os == "android"',
+
+ ['skia_os == "android"',
{
'defines': [
'SK_BUILD_FOR_ANDROID',
}],
],
}],
- ],
+ ],
},
],
'skia_arch_type%': 'x86',
'android_make_apk%': 1,
'skia_gpu%': 1,
+ 'skia_static_initializers%': 1,
},
# Re-define all variables defined within the level-2 'variables' dict,
'skia_arch_width%': '<(skia_arch_width)',
'android_make_apk%': '<(android_make_apk)',
'skia_gpu%': '<(skia_gpu)',
-
+ 'skia_static_initializers%': '<(skia_static_initializers)',
+
# These are referenced by our .gypi files that list files (e.g. core.gypi)
#
'skia_src_path%': '../src',
'../src/gpu', # To pull gl/GrGLUtil.h
],
'sources': [
- '../debugger/debuggermain.cpp',
+ '../debugger/debuggermain.cpp',
'../debugger/SkDebugCanvas.h',
'../debugger/SkDebugCanvas.cpp',
'../debugger/SkDebugger.cpp',