Bug 1149461 - Disable progressive drawing unless the compositor is actively scrolling a tiled layer. r=nical, a=bajaj
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 07 Apr 2015 10:43:28 -0400
changeset 238138 9197f5c1dd5139ac7ad0c65b0d4b339f29d2b5e8
parent 238137 dc0fce2633ddbf39143a98344af36155afc900a9
child 238139 12f606a4cddd2653c2bd3d41dc034fca564a7b39
push id488
push userryanvm@gmail.com
push dateMon, 13 Apr 2015 20:29:57 +0000
treeherdermozilla-b2g37_v2_2@85ea1be9ac7d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical, bajaj
bugs1149461
milestone37.0
Bug 1149461 - Disable progressive drawing unless the compositor is actively scrolling a tiled layer. r=nical, a=bajaj
gfx/layers/client/ClientTiledPaintedLayer.cpp
--- a/gfx/layers/client/ClientTiledPaintedLayer.cpp
+++ b/gfx/layers/client/ClientTiledPaintedLayer.cpp
@@ -242,27 +242,25 @@ ClientTiledPaintedLayer::UseProgressiveD
 
   if (GetIsFixedPosition() || GetParent()->GetIsFixedPosition()) {
     // This layer is fixed-position and so even if it does have a scrolling
     // ancestor it will likely be entirely on-screen all the time, so we
     // should draw it all at once
     return false;
   }
 
-  // XXX We probably want to disable progressive drawing for non active APZ layers in the future
-  //     but we should wait for a proper test case before making this change.
-#if 0 //!defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ANDROID_APZ)
-  LayerMetricsWrapper scrollAncestor;
-  GetAncestorLayers(&scrollAncestor, nullptr, nullptr);
-  MOZ_ASSERT(scrollAncestor); // because mPaintData.mCriticalDisplayPort is non-empty
-  const FrameMetrics& parentMetrics = scrollAncestor.Metrics();
-  if (!IsScrollingOnCompositor(parentMetrics)) {
-    return false;
+  if (gfxPrefs::AsyncPanZoomEnabled()) {
+    LayerMetricsWrapper scrollAncestor;
+    GetAncestorLayers(&scrollAncestor, nullptr, nullptr);
+    MOZ_ASSERT(scrollAncestor); // because mPaintData.mCriticalDisplayPort is non-empty
+    const FrameMetrics& parentMetrics = scrollAncestor.Metrics();
+    if (!IsScrollingOnCompositor(parentMetrics)) {
+      return false;
+    }
   }
-#endif
 
   return true;
 }
 
 bool
 ClientTiledPaintedLayer::RenderHighPrecision(nsIntRegion& aInvalidRegion,
                                             const nsIntRegion& aVisibleRegion,
                                             LayerManager::DrawPaintedLayerCallback aCallback,