Bug 994541 - Enable BasicCompositor OMTC on linux. r=Bas
authorChris Lord <chrislord.net@gmail.com>
Thu, 12 Mar 2015 14:01:23 +0100
changeset 239510 662e8039bc4c99d7db04e8beec5b3fa1480303df
parent 239509 407a15000849f7a0f8a7f611010f0c72cf2af8d1
child 239511 ffe700f4d5c408816cbbd90926c2c10e1b3bf0bb
push id28600
push userryanvm@gmail.com
push dateThu, 16 Apr 2015 20:25:17 +0000
treeherdermozilla-central@51e3cb11a258 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs994541
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 994541 - Enable BasicCompositor OMTC on linux. r=Bas
gfx/thebes/gfxPlatform.cpp
modules/libpref/init/all.js
toolkit/xre/nsAppRunner.cpp
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -2310,22 +2310,16 @@ gfxPlatform::UsesOffMainThreadCompositin
       sPrefBrowserTabsRemoteAutostart ||
       gfxPrefs::LayersOffMainThreadCompositionEnabled() ||
       gfxPrefs::LayersOffMainThreadCompositionForceEnabled() ||
       gfxPrefs::LayersOffMainThreadCompositionTestingEnabled();
 #if defined(MOZ_WIDGET_GTK)
     // Linux users who chose OpenGL are being grandfathered in to OMTC
     result |= gfxPrefs::LayersAccelerationForceEnabled();
 
-#if !defined(NIGHTLY_BUILD)
-    // Yeah, these two env vars do the same thing.
-    // I'm told that one of them is enabled on some test slaves config,
-    // so be slightly careful if you think you can remove one of them.
-    result &= PR_GetEnv("MOZ_USE_OMTC") || PR_GetEnv("MOZ_OMTC_ENABLED");
-#endif
 #endif
     firstTime = false;
   }
 
   return result;
 }
 
 already_AddRefed<mozilla::gfx::VsyncSource>
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -4008,47 +4008,33 @@ pref("layers.max-active", -1);
 // If this is set the tile size will only be treated as a suggestion.
 // On B2G we will round this to the stride of the underlying allocation.
 // On any platform we may later use the screen size and ignore
 // tile-width/tile-height entirely. Its recommended to turn this off
 // if you change the tile size.
 pref("layers.tiles.adjust", true);
 
 // Set the default values, and then override per-platform as needed
-pref("layers.offmainthreadcomposition.enabled", false);
+pref("layers.offmainthreadcomposition.enabled", true);
 // Compositor target frame rate. NOTE: If vsync is enabled the compositor
 // frame rate will still be capped.
 // -1 -> default (match layout.frame_rate or 60 FPS)
 // 0  -> full-tilt mode: Recomposite even if not transaction occured.
 pref("layers.offmainthreadcomposition.frame-rate", -1);
 
 // Asynchonous video compositing using the ImageBridge IPDL protocol.
 // requires off-main-thread compositing.
 pref("layers.async-video.enabled", true);
 pref("layers.async-video-oop.enabled",true);
 
-#ifdef XP_WIN
-pref("layers.offmainthreadcomposition.enabled", true);
-#endif
-
-#ifdef MOZ_WIDGET_QT
-pref("layers.offmainthreadcomposition.enabled", true);
-#endif
-
 #ifdef XP_MACOSX
-pref("layers.offmainthreadcomposition.enabled", true);
 pref("layers.enable-tiles", true);
 pref("layers.tiled-drawtarget.enabled", true);
 #endif
 
-// ANDROID covers android and b2g
-#ifdef ANDROID
-pref("layers.offmainthreadcomposition.enabled", true);
-#endif
-
 // same effect as layers.offmainthreadcomposition.enabled, but specifically for
 // use with tests.
 pref("layers.offmainthreadcomposition.testing.enabled", false);
 
 // whether to allow use of the basic compositor
 pref("layers.offmainthreadcomposition.force-basic", false);
 
 // Whether to animate simple opacity and transforms on the compositor
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -3605,35 +3605,19 @@ XREMain::XRE_mainStartup(bool* aExitFlag
     display_name = PR_GetEnv("DISPLAY");
     if (!display_name) {
       PR_fprintf(PR_STDERR, "Error: no display specified\n");
       return 1;
     }
   }
 #endif /* MOZ_WIDGET_GTK */
 #ifdef MOZ_X11
-  // Init X11 in thread-safe mode. Must be called prior to the first call to XOpenDisplay 
+  // Init X11 in thread-safe mode. Must be called prior to the first call to XOpenDisplay
   // (called inside gdk_display_open). This is a requirement for off main tread compositing.
-  // This is done only on X11 platforms if the environment variable MOZ_USE_OMTC is set so 
-  // as to avoid overhead when omtc is not used. 
-  //
-  // On nightly builds, we call this by default to enable OMTC for Electrolysis testing. On
-  // aurora, beta, and release builds, there is a small tpaint regression from enabling this
-  // call, so it sits behind an environment variable.
-  //
-  // An environment variable is used instead of a pref on X11 platforms because we start having 
-  // access to prefs long after the first call to XOpenDisplay which is hard to change due to 
-  // interdependencies in the initialization.
-# ifndef NIGHTLY_BUILD
-  if (PR_GetEnv("MOZ_USE_OMTC") ||
-      PR_GetEnv("MOZ_OMTC_ENABLED"))
-# endif
-  {
-    XInitThreads();
-  }
+  XInitThreads();
 #endif
 #if defined(MOZ_WIDGET_GTK)
   {
     mGdkDisplay = gdk_display_open(display_name);
     if (!mGdkDisplay) {
       PR_fprintf(PR_STDERR, "Error: cannot open display: %s\n", display_name);
       return 1;
     }