Bug 1166301 - Allow async scrolling to move the clip rects of fixed background layers. r=mattwoodrow draft
authorBotond Ballo <botond@mozilla.com>
Mon, 31 Aug 2015 21:44:29 -0400
changeset 289359 a2321fbe40075f2d6c76c20f1bfb2cd64c2c75ed
parent 289358 3f582e8b20998430450383dcc839ef005d96a312
child 289360 c434aa012ac1a1522d2ca4133dea57924206c6aa
push id4975
push userbballo@mozilla.com
push dateTue, 01 Sep 2015 01:57:17 +0000
reviewersmattwoodrow
bugs1166301
milestone43.0a1
Bug 1166301 - Allow async scrolling to move the clip rects of fixed background layers. r=mattwoodrow
gfx/layers/composite/AsyncCompositionManager.cpp
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -362,18 +362,22 @@ AsyncCompositionManager::AlignFixedAndSt
 
   // Finally, apply the translation to the layer transform. Note that in
   // general we need to apply the same translation to the layer's clip rect, so
   // that the effective transform on the clip rect takes it back to where it was
   // originally, had there been no async scroll. In the case where the
   // fixed/sticky layer is the same as aTransformedSubtreeRoot, then the clip
   // rect is not affected by the scroll-induced async scroll transform anyway
   // (since the clip is applied post-transform) so we don't need to make the
-  // adjustment.
-  TranslateShadowLayer(aLayer, ThebesPoint(translation), aLayer != aTransformedSubtreeRoot);
+  // adjustment. Also, if a layer is a fixed background layer, we want async
+  // scrolling to move its clip rect, so we don't make a compensating
+  // adjustment here.
+  bool adjustClipRect = aLayer != aTransformedSubtreeRoot &&
+                        !aLayer->IsFixedBackground();
+  TranslateShadowLayer(aLayer, ThebesPoint(translation), adjustClipRect);
 }
 
 static void
 SampleValue(float aPortion, Animation& aAnimation, StyleAnimationValue& aStart,
             StyleAnimationValue& aEnd, Animatable* aValue)
 {
   StyleAnimationValue interpolatedValue;
   NS_ASSERTION(aStart.GetUnit() == aEnd.GetUnit() ||