Bug 1248822 - In LayerManagerComposite::UpdateAndRender(), call PostProcessLayers() before LayerTreeInvalidation. r=mattwoodrow draft
authorBotond Ballo <botond@mozilla.com>
Mon, 08 Feb 2016 19:01:45 -0500
changeset 331390 8e13690e3317f6e9f75789a4d4a43f5f424d5f53
parent 330813 6f59c569ac0b66534fbd5f5cbf41b47ac7b26add
child 514375 9cb5397bd68b32d47a46fcee312297c985b5dd99
push id10976
push userbballo@mozilla.com
push dateWed, 17 Feb 2016 01:24:08 +0000
reviewersmattwoodrow
bugs1248822
milestone47.0a1
Bug 1248822 - In LayerManagerComposite::UpdateAndRender(), call PostProcessLayers() before LayerTreeInvalidation. r=mattwoodrow The reason is that PostProcessLayers() can change the effective visible region, and LayerTreeInvalidation needs the final effective visible region. MozReview-Commit-ID: 1wLROyOTcIB
gfx/layers/composite/LayerManagerComposite.cpp
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -380,16 +380,20 @@ LayerManagerComposite::EndTransaction(co
 }
 
 void
 LayerManagerComposite::UpdateAndRender()
 {
   nsIntRegion invalid;
   bool didEffectiveTransforms = false;
 
+  nsIntRegion opaque;
+  LayerIntRegion visible;
+  PostProcessLayers(mRoot, opaque, visible, Nothing());
+
   if (mClonedLayerTreeProperties) {
     // Effective transforms are needed by ComputeDifferences().
     mRoot->ComputeEffectiveTransforms(gfx::Matrix4x4());
     didEffectiveTransforms = true;
 
     // We need to compute layer tree differences even if we're not going to
     // immediately use the resulting damage area, since ComputeDifferences
     // is also responsible for invalidates intermediate surfaces in
@@ -433,20 +437,16 @@ LayerManagerComposite::UpdateAndRender()
   InvalidateDebugOverlay(invalid, mRenderBounds);
 
   if (!didEffectiveTransforms) {
     // The results of our drawing always go directly into a pixel buffer,
     // so we don't need to pass any global transform here.
     mRoot->ComputeEffectiveTransforms(gfx::Matrix4x4());
   }
 
-  nsIntRegion opaque;
-  LayerIntRegion visible;
-  PostProcessLayers(mRoot, opaque, visible, Nothing());
-
   Render(invalid);
 #if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GONK)
   RenderToPresentationSurface();
 #endif
   mGeometryChanged = false;
   mWindowOverlayChanged = false;
 
   // Update cached layer tree information.