Backed out changeset ea2341b06e6f (bug 994541) for reftest timeouts FIREFOX_AURORA_33_BASE
authorEd Morley <emorley@mozilla.com>
Mon, 21 Jul 2014 17:26:40 +0100
changeset 195309 dc23164ba2a289a8b22902e30990c77d9677c214
parent 195308 4df3b2ee48173e1a12fa279218d7195067805ac6
child 195310 bab6e7dff3d57d024b24828cf2bd5e2775338f1c
push idunknown
push userunknown
push dateunknown
bugs994541
milestone33.0a1
backs outea2341b06e6fe167dd3a458de0998c8d560a3d6f
Backed out changeset ea2341b06e6f (bug 994541) for reftest timeouts
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,37 +3827,54 @@ 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", true);
+pref("layers.offmainthreadcomposition.enabled", false);
 // 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,16 +867,30 @@ 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!
 
@@ -896,16 +910,20 @@ 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();