Bug 899702 - Only attempt load of egltrace.so when a pref is set. r=vlad, a=bajaj
authorGeorge Wright <gw@gwright.org.uk>
Tue, 30 Jul 2013 14:54:29 -0400
changeset 153920 42d7eed1d9bc397e8342c5952c395ba28c4a3fef
parent 153919 0d081e6fa4560717502d1e8b3eeb8f43b84b4135
child 153921 7d35528a8e849ca7cdd750bfebddc98826e26a5e
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvlad, bajaj
bugs899702
milestone25.0a2
Bug 899702 - Only attempt load of egltrace.so when a pref is set. r=vlad, a=bajaj
gfx/gl/GLLibraryEGL.cpp
modules/libpref/src/init/all.js
--- a/gfx/gl/GLLibraryEGL.cpp
+++ b/gfx/gl/GLLibraryEGL.cpp
@@ -27,16 +27,28 @@ static const char *sExtensionNames[] = {
     "EGL_KHR_fence_sync",
     nullptr
 };
 
 #if defined(ANDROID)
 
 static PRLibrary* LoadApitraceLibrary()
 {
+    static bool sUseApitraceInitialized = false;
+    static bool sUseApitrace = false;
+
+    if (!sUseApitraceInitialized) {
+        sUseApitrace = Preferences::GetBool("gfx.apitrace.enabled", false);
+        sUseApitraceInitialized = true;
+    }
+
+    if (!sUseApitrace) {
+        return nullptr;
+    }
+
     static PRLibrary* sApitraceLibrary = nullptr;
 
     if (sApitraceLibrary)
         return sApitraceLibrary;
 
     nsCString logFile = Preferences::GetCString("gfx.apitrace.logfile");
 
     if (logFile.IsEmpty()) {
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -4089,16 +4089,20 @@ pref("layers.offmainthreadcomposition.en
 pref("layers.offmainthreadcomposition.testing.enabled", false);
 // Whether to animate simple opacity and transforms on the compositor
 pref("layers.offmainthreadcomposition.async-animations", false);
 // Whether to prefer normal memory over shared memory. Ignored with cross-process compositing
 pref("layers.prefer-memory-over-shmem", true);
 
 pref("layers.bufferrotation.enabled", true);
 
+#ifdef ANDROID
+pref("gfx.apitrace.enabled",false);
+#endif
+
 #ifdef MOZ_X11
 #ifdef MOZ_WIDGET_GTK2
 pref("gfx.xrender.enabled",true);
 #endif
 #endif
 
 #ifdef XP_WIN
 // Whether to disable the automatic detection and use of direct2d.