Bug 1336519 - Don't try to detect scrolled clips using AGRs in non-APZ mode. r=mattwoodrow
authorMarkus Stange <mstange@themasta.com>
Fri, 03 Feb 2017 13:41:37 -0500
changeset 388365 7796783a9de92b38e7f0e9cb4cba840daaf7fd84
parent 388364 d2eb1c66346f716966e618b68886f7a7dd02f902
child 388366 6d33d3de96d29d1f6ade36b55c556746cd59e0a7
push id7198
push userjlorenzo@mozilla.com
push dateTue, 18 Apr 2017 12:07:49 +0000
treeherdermozilla-beta@d57aa49c3948 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1336519, 1298218, 1336516
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1336519 - Don't try to detect scrolled clips using AGRs in non-APZ mode. r=mattwoodrow Before bug 1298218, in this if branch with APZ enabled, itemClip was always the display port clip for fixed backgrounds, even for fixed backgrounds on the canvas frame. But after bug 1298218 we no longer clip canvas fixed backgrounds to the display port, so itemClip is now the viewport clip. And that clip is definitely not a scrolled clip, so we must not merge layers around it. The better solution for this would be to remove this if branch completely and fix up the scrolled clip layerization detection for the non-APZ case to also use ASRs. That's tracked by bug 1336516. MozReview-Commit-ID: 2F7hPrldUlq
layout/painting/FrameLayerBuilder.cpp
layout/reftests/async-scrolling/bg-fixed-child-no-culling-3-ref.html
layout/reftests/async-scrolling/bg-fixed-child-no-culling-3.html
layout/reftests/async-scrolling/reftest.list
--- a/layout/painting/FrameLayerBuilder.cpp
+++ b/layout/painting/FrameLayerBuilder.cpp
@@ -4171,21 +4171,23 @@ ContainerState::ProcessDisplayItems(nsDi
         const ActiveScrolledRoot* clipASR = layerClipChain->mASR;
         AnimatedGeometryRoot* clipAGR = mBuilder->AnimatedGeometryRootForASR(clipASR);
         nsIntRect scrolledClipRect =
           ScaleToNearestPixels(layerClipChain->mClip.GetClipRect()) + mParameters.mOffset;
         mPaintedLayerDataTree.AddingOwnLayer(clipAGR,
                                              &scrolledClipRect,
                                              uniformColorPtr);
       } else if (item->ShouldFixToViewport(mBuilder) && itemClip.HasClip() &&
-                 item->AnimatedGeometryRootForScrollMetadata() != animatedGeometryRoot) {
+                 item->AnimatedGeometryRootForScrollMetadata() != animatedGeometryRoot &&
+                 !nsLayoutUtils::UsesAsyncScrolling(item->Frame())) {
         // This is basically the same as the case above, but for the non-APZ
         // case. At the moment, when APZ is off, there is only the root ASR
         // (because scroll frames without display ports don't create ASRs) and
         // the whole clip chain is always just one fused clip.
+        // Bug 1336516 aims to change that and to remove this workaround.
         AnimatedGeometryRoot* clipAGR = item->AnimatedGeometryRootForScrollMetadata();
         nsIntRect scrolledClipRect =
           ScaleToNearestPixels(itemClip.GetClipRect()) + mParameters.mOffset;
         mPaintedLayerDataTree.AddingOwnLayer(clipAGR,
                                              &scrolledClipRect,
                                              uniformColorPtr);
       } else if (*animatedGeometryRoot == item->Frame() &&
                  *animatedGeometryRoot != mBuilder->RootReferenceFrame()) {
new file mode 100644
--- /dev/null
+++ b/layout/reftests/async-scrolling/bg-fixed-child-no-culling-3-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<html>
+<body style="overflow:hidden; margin:0;">
+  <div style="width: 200px; height: 100px; background: lime;"></div>
+  </div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/async-scrolling/bg-fixed-child-no-culling-3.html
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML>
+<html reftest-async-scroll
+      reftest-displayport-x="0" reftest-displayport-y="-150"
+      reftest-displayport-w="800" reftest-displayport-h="2000"
+      reftest-async-scroll-x="0" reftest-async-scroll-y="-150"
+      style="overflow: hidden; background: linear-gradient(white, white) top left fixed no-repeat;">
+<body style="height: 3000px; margin: 0;">
+  <div style="width: 200px; height: 100px; background: lime;"></div>
+
+  <script>
+    document.documentElement.scrollTop = 150;
+  </script>
+
+</body>
+</html>
--- a/layout/reftests/async-scrolling/reftest.list
+++ b/layout/reftests/async-scrolling/reftest.list
@@ -4,16 +4,17 @@ skip-if(!asyncPan) == bg-fixed-cover-2.h
 skip-if(!asyncPan) == bg-fixed-cover-3.html bg-fixed-cover-3-ref.html
 skip-if(!asyncPan) == bg-fixed-child.html bg-fixed-child-ref.html
 skip-if(!asyncPan) == bg-fixed-child-clip-1.html bg-fixed-child-clip-ref.html
 skip-if(!asyncPan) == bg-fixed-child-clip-2.html bg-fixed-child-clip-ref.html
 fuzzy(1,246) fuzzy-if(skiaContent,2,160) fuzzy-if(browserIsRemote&&d2d,53,185) skip-if(!asyncPan) == bg-fixed-child-mask.html bg-fixed-child-mask-ref.html
 skip-if(!asyncPan) == bg-fixed-in-opacity.html bg-fixed-in-opacity-ref.html
 skip-if(!asyncPan) == bg-fixed-child-no-culling-1.html bg-fixed-child-no-culling-1-ref.html
 skip-if(!asyncPan) == bg-fixed-child-no-culling-2.html bg-fixed-child-no-culling-2-ref.html
+skip-if(!asyncPan) == bg-fixed-child-no-culling-3.html bg-fixed-child-no-culling-3-ref.html
 fuzzy-if(Android,2,4000) fuzzy-if(browserIsRemote&&cocoaWidget,2,179524) fuzzy-if(browserIsRemote&&winWidget,1,74590) fuzzy-if(gtkWidget&&layersGPUAccelerated,1,3528) skip-if(!asyncPan) == bg-fixed-transformed-image.html bg-fixed-transformed-image-ref.html
 skip-if(!asyncPan) == element-1.html element-1-ref.html
 pref(layers.force-active,true) skip-if(!asyncPan) == iframe-1.html iframe-1-ref.html
 skip-if(!asyncPan) == nested-1.html nested-1-ref.html
 skip-if(!asyncPan) == nested-2.html nested-2-ref.html
 skip-if(!asyncPan) == position-fixed-1.html position-fixed-1-ref.html
 skip-if(!asyncPan) == position-fixed-2.html position-fixed-2-ref.html
 skip-if(!asyncPan) == position-fixed-body.html position-fixed-body-ref.html