Chromium Code Reviews| Index: Source/core/rendering/RenderLayer.cpp |
| diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp |
| index 674186b357cc25273a1c4e223c1de0ad0ca2c62d..3a0f396013cbf34c1079a71d8ae3eb24f96ead11 100644 |
| --- a/Source/core/rendering/RenderLayer.cpp |
| +++ b/Source/core/rendering/RenderLayer.cpp |
| @@ -263,10 +263,10 @@ void RenderLayer::updateLayerPositionsAfterLayout(const RenderLayer* rootLayer, |
| RenderGeometryMap geometryMap(UseTransforms); |
| if (this != rootLayer) |
| geometryMap.pushMappingsToAncestor(parent(), 0); |
| - updateLayerPositions(&geometryMap, flags); |
| + updateLayerPositions(&geometryMap, rootLayer->renderer()->containerForRepaint(), flags); |
| } |
| -void RenderLayer::updateLayerPositions(RenderGeometryMap* geometryMap, UpdateLayerPositionsFlags flags) |
| +void RenderLayer::updateLayerPositions(RenderGeometryMap* geometryMap, const RenderLayerModelObject* paintInvalidationContainer, UpdateLayerPositionsFlags flags) |
| { |
| updateLayerPosition(); // For relpositioned layers or non-positioned layers, |
| // we need to keep in sync, since we may have shifted relative |
| @@ -298,6 +298,18 @@ void RenderLayer::updateLayerPositions(RenderGeometryMap* geometryMap, UpdateLay |
| m_enclosingPaginationLayer = 0; |
| } |
| + const RenderLayerModelObject* newPaintInvalidationContainer = paintInvalidationContainer; |
| + if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { |
| + bool establishesNewPaintInvalidationContainer = isRepaintContainer(); |
| + newPaintInvalidationContainer = renderer()->adjustCompositedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? renderer() : paintInvalidationContainer); |
| + |
| + if (geometryMap) { |
| + LayoutPoint offset = renderer()->isBox() ? toRenderBox(renderer())->location() : LayoutPoint(); |
| + if (renderer()->previousPositionFromPaintInvalidationContainer() != geometryMap->mapToContainer(offset, newPaintInvalidationContainer)) |
| + renderer()->setMayNeedPaintInvalidation(true); |
|
leviw_travelin_and_unemployed
2014/06/02 20:47:21
I still don't love this We're only okay because we
dsinclair
2014/06/02 20:58:07
Done. Is this better?
|
| + } |
| + } |
| + |
| repainter().repaintAfterLayout(flags & CheckForRepaint); |
| // Go ahead and update the reflection's position and size. |
| @@ -313,7 +325,7 @@ void RenderLayer::updateLayerPositions(RenderGeometryMap* geometryMap, UpdateLay |
| flags |= UpdatePagination; |
| for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) |
| - child->updateLayerPositions(geometryMap, flags); |
| + child->updateLayerPositions(geometryMap, newPaintInvalidationContainer, flags); |
| if ((flags & NeedsFullRepaintInBacking) && hasCompositedLayerMapping() && !compositedLayerMapping()->paintsIntoCompositedAncestor()) |
| compositedLayerMapping()->setContentsNeedDisplay(); |
| @@ -1483,7 +1495,7 @@ void RenderLayer::removeOnlyThisLayer() |
| // Hits in compositing/overflow/automatically-opt-into-composited-scrolling-part-1.html |
| DisableCompositingQueryAsserts disabler; |
| - current->updateLayerPositions(0); // FIXME: use geometry map. |
| + current->updateLayerPositions(0, 0); // FIXME: use geometry map. |
| current = next; |
| } |