Chromium Code Reviews| Index: Source/core/paint/DeprecatedPaintLayer.cpp |
| diff --git a/Source/core/paint/DeprecatedPaintLayer.cpp b/Source/core/paint/DeprecatedPaintLayer.cpp |
| index 89259e5756a3a9737f6a8c3c9554e9f21fbe8b2e..f97818579d50049e2ae46abf97941b34ebdc614e 100644 |
| --- a/Source/core/paint/DeprecatedPaintLayer.cpp |
| +++ b/Source/core/paint/DeprecatedPaintLayer.cpp |
| @@ -2123,10 +2123,12 @@ LayoutRect DeprecatedPaintLayer::fragmentsBoundingBox(const DeprecatedPaintLayer |
| LayoutRect DeprecatedPaintLayer::boundingBoxForCompositingOverlapTest() const |
| { |
| - return overlapBoundsIncludeChildren() ? boundingBoxForCompositing() : fragmentsBoundingBox(this); |
| + // Apply NeverIncludeTransformForAncestorLayer, because the geometry map in CompositingInputsUpdater will take care of applying the |
| + // transform of |this| (== the ancestorLayer argument to boundingBoxForCompositing). |
| + return overlapBoundsIncludeChildren() ? boundingBoxForCompositing(this, NeverIncludeTransformForAncestorLayer) : fragmentsBoundingBox(this); |
| } |
| -static void expandRectForReflectionAndStackingChildren(const DeprecatedPaintLayer* ancestorLayer, DeprecatedPaintLayer::CalculateBoundsOptions options, LayoutRect& result) |
| +static void expandRectForReflectionAndStackingChildren(const DeprecatedPaintLayer* ancestorLayer, LayoutRect& result) |
| { |
| if (ancestorLayer->reflectionInfo() && !ancestorLayer->reflectionInfo()->reflectionLayer()->hasCompositedDeprecatedPaintLayerMapping()) |
| result.unite(ancestorLayer->reflectionInfo()->reflectionLayer()->boundingBoxForCompositing(ancestorLayer)); |
| @@ -2140,13 +2142,13 @@ static void expandRectForReflectionAndStackingChildren(const DeprecatedPaintLaye |
| DeprecatedPaintLayerStackingNodeIterator iterator(*ancestorLayer->stackingNode(), AllChildren); |
| while (DeprecatedPaintLayerStackingNode* node = iterator.next()) { |
| // Here we exclude both directly composited layers and squashing layers |
| - // because those Layers don't paint into the graphics layer |
| + // because those Layers don't paint into the graphics layer4 |
|
Xianzhu
2015/08/27 17:15:07
Nit: typo
chrishtr
2015/08/27 17:31:51
Fixed.
|
| // for this Layer. For example, the bounds of squashed Layers |
| // will be included in the computation of the appropriate squashing |
| // GraphicsLayer. |
| - if (options != DeprecatedPaintLayer::ApplyBoundsChickenEggHacks && node->layer()->compositingState() != NotComposited) |
| + if (node->layer()->compositingState() != NotComposited) |
| continue; |
| - result.unite(node->layer()->boundingBoxForCompositing(ancestorLayer, options)); |
| + result.unite(node->layer()->boundingBoxForCompositing(ancestorLayer)); |
| } |
| } |
| @@ -2157,7 +2159,7 @@ LayoutRect DeprecatedPaintLayer::physicalBoundingBoxIncludingReflectionAndStacki |
| const_cast<DeprecatedPaintLayer*>(this)->stackingNode()->updateLayerListsIfNeeded(); |
| - expandRectForReflectionAndStackingChildren(this, DoNotApplyBoundsChickenEggHacks, result); |
| + expandRectForReflectionAndStackingChildren(this, result); |
| result.moveBy(offsetFromRoot); |
| return result; |
| @@ -2199,9 +2201,9 @@ LayoutRect DeprecatedPaintLayer::boundingBoxForCompositing(const DeprecatedPaint |
| // children of the parent, that need to be included in reflected composited bounds. |
| // Fix this by including composited bounds of stacking children of the reflected Layer. |
| if (hasCompositedDeprecatedPaintLayerMapping() && parent() && parent()->reflectionInfo() && parent()->reflectionInfo()->reflectionLayer() == this) |
| - expandRectForReflectionAndStackingChildren(parent(), options, result); |
| + expandRectForReflectionAndStackingChildren(parent(), result); |
| else |
| - expandRectForReflectionAndStackingChildren(this, options, result); |
| + expandRectForReflectionAndStackingChildren(this, result); |
| // FIXME: We can optimize the size of the composited layers, by not enlarging |
| // filtered areas with the outsets if we know that the filter is going to render in hardware. |
| @@ -2209,7 +2211,7 @@ LayoutRect DeprecatedPaintLayer::boundingBoxForCompositing(const DeprecatedPaint |
| result.expand(m_layoutObject->style()->filterOutsets()); |
| } |
| - if (transform() && (paintsWithTransform(GlobalPaintNormalPhase) || options == ApplyBoundsChickenEggHacks)) |
| + if (transform() && paintsWithTransform(GlobalPaintNormalPhase) && (this != ancestorLayer || options == MaybeIncludeTransformForAncestorLayer)) |
| result = transform()->mapRect(result); |
| if (enclosingPaginationLayer()) { |