Bug 1062100 - Part 3: When layers are flattened, let all the layers contribute opaqueness to the container layer, whatever their animated geometry roots are. r=tn, a=lmandel
authorRobert O'Callahan <robert@ocallahan.org>
Wed, 17 Sep 2014 18:45:47 +1200
changeset 218364 d261f0165d94ae39023d71d7399635d82be97ebf
parent 218363 231126bd4179a1ba74084c1adf459ed4ee4fe5fc
child 218365 a721c4fbe22abf0ea6a591957aa42e118ea04c54
push id7100
push userryanvm@gmail.com
push dateSat, 11 Oct 2014 22:05:28 +0000
treeherdermozilla-aurora@e96a7a4f3bbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn, lmandel
bugs1062100
milestone34.0a2
Bug 1062100 - Part 3: When layers are flattened, let all the layers contribute opaqueness to the container layer, whatever their animated geometry roots are. r=tn, a=lmandel
layout/base/FrameLayerBuilder.cpp
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -3538,18 +3538,23 @@ ContainerState::PostprocessRetainedLayer
   int32_t opaqueRegionForContainer = -1;
 
   for (int32_t i = mNewChildLayers.Length() - 1; i >= 0; --i) {
     NewLayerEntry* e = &mNewChildLayers.ElementAt(i);
     if (!e->mLayer) {
       continue;
     }
 
+    // If mFlattenToSingleLayer is true, there isn't going to be any
+    // async scrolling so we can apply all our opaqueness to the same
+    // entry, the entry for mContainerAnimatedGeometryRoot.
+    const nsIFrame* animatedGeometryRootForOpaqueness =
+        mFlattenToSingleLayer ? mContainerAnimatedGeometryRoot : e->mAnimatedGeometryRoot;
     OpaqueRegionEntry* data = FindOpaqueRegionEntry(opaqueRegions,
-        e->mAnimatedGeometryRoot, e->mFixedPosFrameForLayerData);
+        animatedGeometryRootForOpaqueness, e->mFixedPosFrameForLayerData);
 
     SetupScrollingMetadata(e);
 
     if (hideAll) {
       e->mVisibleRegion.SetEmpty();
     } else {
       const nsIntRect* clipRect = e->mLayer->GetClipRect();
       if (clipRect && opaqueRegionForContainer >= 0 &&
@@ -3559,17 +3564,17 @@ ContainerState::PostprocessRetainedLayer
         e->mVisibleRegion.Sub(e->mVisibleRegion, data->mOpaqueRegion);
       }
     }
 
     SetOuterVisibleRegionForLayer(e->mLayer, e->mVisibleRegion,
       e->mLayerContentsVisibleRect.width >= 0 ? &e->mLayerContentsVisibleRect : nullptr);
 
     if (!e->mOpaqueRegion.IsEmpty()) {
-      const nsIFrame* animatedGeometryRootToCover = e->mAnimatedGeometryRoot;
+      const nsIFrame* animatedGeometryRootToCover = animatedGeometryRootForOpaqueness;
       if (e->mOpaqueForAnimatedGeometryRootParent &&
           nsLayoutUtils::GetAnimatedGeometryRootForFrame(e->mAnimatedGeometryRoot->GetParent(),
                                                          mContainerAnimatedGeometryRoot)
             == mContainerAnimatedGeometryRoot) {
         animatedGeometryRootToCover = mContainerAnimatedGeometryRoot;
         data = FindOpaqueRegionEntry(opaqueRegions,
             animatedGeometryRootToCover, e->mFixedPosFrameForLayerData);
       }