Bug 1022612. Part 15.5: Use GetVisibleRectForChildren instead of GetVisibleRect. r=mattwoodrow
☠☠ backed out by 2bcded4e3b4a ☠ ☠
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 15 Jul 2014 23:49:38 +1200
changeset 216611 a3d1a3e8b39dacd069bcd6901c244c8d0dca8091
parent 216610 8974b74b0eb004bd9df4b6cc77f55b2ac998b4d2
child 216612 cc2c5397ca8b6139fc2c39eab0691df5d29319d2
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1022612
milestone33.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 1022612. Part 15.5: Use GetVisibleRectForChildren instead of GetVisibleRect. r=mattwoodrow
layout/base/FrameLayerBuilder.cpp
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -3448,18 +3448,24 @@ FrameLayerBuilder::BuildContainerLayerFo
     // early exit because later, invalidation will walk up the frame tree to
     // determine which thebes layer gets invalidated. Since an empty layer
     // should never have anything to paint, it should never be invalidated.
     NS_ASSERTION(aChildren->IsEmpty(), "Should have no children");
     return containerLayer.forget();
   }
 
   ContainerLayerParameters scaleParameters;
-  if (!ChooseScaleAndSetTransform(this, aBuilder, aContainerFrame, aChildren.GetVisibleRect(),
-                                  aTransform, aParameters, containerLayer, state, scaleParameters)) {
+  nsRect bounds = aChildren->GetBounds(aBuilder);
+  nsRect childrenVisible =
+      aContainerItem ? aContainerItem->GetVisibleRectForChildren() :
+          aContainerFrame->GetVisualOverflowRectRelativeToSelf();
+  if (!ChooseScaleAndSetTransform(this, aBuilder, aContainerFrame,
+                                  bounds.Intersect(childrenVisible),
+                                  aTransform, aParameters,
+                                  containerLayer, state, scaleParameters)) {
     return nullptr;
   }
 
   uint32_t oldGeneration = mContainerLayerGeneration;
   mContainerLayerGeneration = ++mMaxContainerLayerGeneration;
 
   nsRefPtr<RefCountedRegion> thebesLayerInvalidRegion = nullptr;
   if (mRetainingManager) {
@@ -3468,17 +3474,16 @@ FrameLayerBuilder::BuildContainerLayerFo
     } else {
       StoreDataForFrame(aContainerFrame, containerDisplayItemKey, containerLayer, LAYER_ACTIVE);
     }
   }
 
   LayerManagerData* data = static_cast<LayerManagerData*>
     (aManager->GetUserData(&gLayerManagerUserData));
 
-  nsRect bounds = aChildren->GetBounds(aBuilder);
   nsIntRect pixBounds;
   int32_t appUnitsPerDevPixel;
   uint32_t stateFlags = 0;
   if ((aContainerFrame->GetStateBits() & NS_FRAME_NO_COMPONENT_ALPHA) &&
       mRetainingManager && !mRetainingManager->AreComponentAlphaLayersEnabled()) {
     stateFlags = ContainerState::NO_COMPONENT_ALPHA;
   }
   uint32_t flags;