Effects Bug Fix

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
This commit is contained in:
chudy@google.com 2012-08-13 14:26:36 +00:00
parent 82aa7482cb
commit bbad34de3b
5 changed files with 30 additions and 9 deletions

View File

@ -5,8 +5,8 @@
* found in the LICENSE file.
*/
#include <iostream>
#include "SkDebuggerGUI.h"
#include "SkGraphics.h"
#include <QListWidgetItem>
SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) :
@ -91,9 +91,13 @@ 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;

12
debugger/make_debugger.sh Executable file
View File

@ -0,0 +1,12 @@
# 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

View File

@ -1,6 +1,9 @@
# conditions used in both common.gypi and skia.gyp in chromium
#
{
'defines': [
'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=<(skia_static_initializers)',
],
'conditions' : [
['skia_gpu == 1',
{
@ -135,7 +138,7 @@
},
],
['skia_os == "mac"',
['skia_os == "mac"',
{
'defines': [
'SK_BUILD_FOR_MAC',
@ -195,7 +198,7 @@
},
],
['skia_os == "ios"',
['skia_os == "ios"',
{
'defines': [
'SK_BUILD_FOR_IOS',
@ -212,8 +215,8 @@
},
},
],
['skia_os == "android"',
['skia_os == "android"',
{
'defines': [
'SK_BUILD_FOR_ANDROID',
@ -285,7 +288,7 @@
}],
],
}],
],
],
},
],

View File

@ -72,6 +72,7 @@
'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,
@ -86,7 +87,8 @@
'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',

View File

@ -10,7 +10,7 @@
'../src/gpu', # To pull gl/GrGLUtil.h
],
'sources': [
'../debugger/debuggermain.cpp',
'../debugger/debuggermain.cpp',
'../debugger/SkDebugCanvas.h',
'../debugger/SkDebugCanvas.cpp',
'../debugger/SkDebugger.cpp',