Bug 1248822 - In LayerManagerComposite::UpdateAndRender(), call PostProcessLayers() before LayerTreeInvalidation. r=mattwoodrow
authorBotond Ballo <botond@mozilla.com>
Mon, 08 Feb 2016 19:01:45 -0500
changeset 338027 7a02a813a179bcd9a1e0640c0177377aa565e2e7
parent 338026 185e10fbb9d31096a19b2ed14dd19c4246cc043c
child 338028 c6056b9dc732791a8a5a098faa6160fed165b151
push id12405
push usercku@mozilla.com
push dateTue, 08 Mar 2016 03:35:29 +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
@@ -420,16 +420,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
@@ -473,20 +477,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.