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
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp
index e2d4bf9..a311916 100644
--- a/debugger/QT/SkDebuggerGUI.cpp
+++ b/debugger/QT/SkDebuggerGUI.cpp
@@ -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 @@
     fMenuEdit.setDisabled(true);
     fMenuNavigate.setDisabled(true);
     fMenuView.setDisabled(true);
+
+    SkGraphics::Init();
 }
 
-SkDebuggerGUI::~SkDebuggerGUI() {}
+SkDebuggerGUI::~SkDebuggerGUI() {
+    SkGraphics::Term();
+}
 
 void SkDebuggerGUI::actionBreakpoints() {
     fBreakpointsActivated = !fBreakpointsActivated;
diff --git a/debugger/make_debugger.sh b/debugger/make_debugger.sh
new file mode 100755
index 0000000..86a7ff9
--- /dev/null
+++ b/debugger/make_debugger.sh
@@ -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