Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1490)

Unified Diff: Source/core/rendering/RenderLayer.cpp

Issue 285103003: [RAL] Make sure RenderLayers are invalidated when moved. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Test Expectations Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/RenderLayerModelObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index 674186b357cc25273a1c4e223c1de0ad0ca2c62d..9c1c2557fe3f31d0667aba1c4dff8baa0723c48a 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -263,11 +263,17 @@ 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)
{
+ // For performance reasons we only check if the RenderObject has moved if we
+ // have a geometryMap. If not, blank out the paint invalidation container so we
+ // can skip doing any further work to update it.
+ if (!geometryMap)
+ paintInvalidationContainer = 0;
+
updateLayerPosition(); // For relpositioned layers or non-positioned layers,
// we need to keep in sync, since we may have shifted relative
// to our parent layer.
@@ -298,6 +304,18 @@ void RenderLayer::updateLayerPositions(RenderGeometryMap* geometryMap, UpdateLay
m_enclosingPaginationLayer = 0;
}
+ const RenderLayerModelObject* newPaintInvalidationContainer = paintInvalidationContainer;
+ // If we don't have a paintInvalidationContainer then we can't check if
+ // the object has moved.
+ if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && paintInvalidationContainer) {
+ bool establishesNewPaintInvalidationContainer = isRepaintContainer();
+ newPaintInvalidationContainer = renderer()->adjustCompositedContainerForSpecialAncestors(establishesNewPaintInvalidationContainer ? renderer() : paintInvalidationContainer);
+
+ LayoutPoint offset = renderer()->isBox() ? toRenderBox(renderer())->location() : LayoutPoint();
+ if (renderer()->previousPositionFromPaintInvalidationContainer() != geometryMap->mapToContainer(offset, newPaintInvalidationContainer))
+ renderer()->setMayNeedPaintInvalidation(true);
+ }
+
repainter().repaintAfterLayout(flags & CheckForRepaint);
// Go ahead and update the reflection's position and size.
@@ -313,7 +331,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 +1501,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;
}
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/RenderLayerModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698