Bug 994541 - Enable OMTC on Linux via BasicCompositor. r=Bas
☠☠ backed out by dc23164ba2a2 ☠ ☠
authorChris Lord <chrislord.net@gmail.com>
Mon, 21 Jul 2014 12:59:05 +0100
changeset 195271 ea2341b06e6fe167dd3a458de0998c8d560a3d6f
parent 195270 e2e07dba59650860990295e79f052dddee73c54d
child 195272 d11fc9a23f6876cb5f1bdc5ea1bd227dccd39385
push id27173
push userkwierso@gmail.com
push dateMon, 21 Jul 2014 19:55:12 +0000
treeherdermozilla-central@c9b967d0e5da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs994541
milestone33.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 OMTC on Linux via BasicCompositor. r=Bas
modules/libpref/src/init/all.js
widget/xpwidgets/nsBaseWidget.cpp
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -3827,54 +3827,37 @@ pref("layers.tile-height", 256);
 // Max number of layers per container. See Overwrite in mobile prefs.
 pref("layers.max-active", -1);
 // When a layer is moving it will add a scroll graph to measure the smoothness
 // of the movement. NOTE: This pref triggers composites to refresh
 // the graph.
 pref("layers.scroll-graph", false);
 
 // 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);
 // XXX - see bug 1009616
 pref("layers.async-video-oop.enabled", false);
 #endif
 
-#ifdef MOZ_WIDGET_QT
-pref("layers.offmainthreadcomposition.enabled", true);
-#endif
-
-#ifdef XP_MACOSX
-pref("layers.offmainthreadcomposition.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
 pref("layers.offmainthreadcomposition.async-animations", false);
 
 // Whether to log information about off main thread animations to stderr
 pref("layers.offmainthreadcomposition.log-animations", false);
 
 pref("layers.bufferrotation.enabled", true);
 
--- a/widget/xpwidgets/nsBaseWidget.cpp
+++ b/widget/xpwidgets/nsBaseWidget.cpp
@@ -867,30 +867,16 @@ nsBaseWidget::GetPreferredCompositorBack
 {
   if (mUseLayersAcceleration) {
     aHints.AppendElement(LayersBackend::LAYERS_OPENGL);
   }
 
   aHints.AppendElement(LayersBackend::LAYERS_BASIC);
 }
 
-static void
-CheckForBasicBackends(nsTArray<LayersBackend>& aHints)
-{
-#ifndef XP_WIN
-  for (size_t i = 0; i < aHints.Length(); ++i) {
-    if (aHints[i] == LayersBackend::LAYERS_BASIC &&
-        !Preferences::GetBool("layers.offmainthreadcomposition.force-basic", false)) {
-      // basic compositor is not stable enough for regular use
-      aHints[i] = LayersBackend::LAYERS_NONE;
-    }
-  }
-#endif
-}
-
 void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
 {
   MOZ_ASSERT(gfxPlatform::UsesOffMainThreadCompositing(),
              "This function assumes OMTC");
 
   // Recreating this is tricky, as we may still have an old and we need
   // to make sure it's properly destroyed by calling DestroyCompositor!
 
@@ -910,20 +896,16 @@ void nsBaseWidget::CreateCompositor(int 
   mCompositorChild = new CompositorChild(lm);
   mCompositorChild->Open(parentChannel, childMessageLoop, ipc::ChildSide);
 
   TextureFactoryIdentifier textureFactoryIdentifier;
   PLayerTransactionChild* shadowManager = nullptr;
   nsTArray<LayersBackend> backendHints;
   GetPreferredCompositorBackends(backendHints);
 
-  if (!mRequireOffMainThreadCompositing) {
-    CheckForBasicBackends(backendHints);
-  }
-
   bool success = false;
   if (!backendHints.IsEmpty()) {
     shadowManager = mCompositorChild->SendPLayerTransactionConstructor(
       backendHints, 0, &textureFactoryIdentifier, &success);
   }
 
   if (success) {
     ShadowLayerForwarder* lf = lm->AsShadowForwarder();