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

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

Issue 379073002: Revert of Divorce PaintInvalidationState from LayoutState (https://codereview.chromium.org/36083300… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Correct revert order Created 6 years, 5 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/RenderListBox.h » ('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 cceb8831eb6bf4003ca9a6e2a7401d66ab4a8350..c7a7d8b95737539a8e8c33f36109a3dca790f3cc 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -552,22 +552,29 @@ void RenderLayer::updatePagination()
}
}
-LayoutPoint RenderLayer::positionFromPaintInvalidationContainer(const RenderObject* renderObject, const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState)
+LayoutPoint RenderLayer::positionFromPaintInvalidationContainer(const RenderObject* renderObject, const RenderLayerModelObject* paintInvalidationContainer)
{
if (!paintInvalidationContainer || !paintInvalidationContainer->layer()->groupedMapping())
- return renderObject->positionFromPaintInvalidationContainer(paintInvalidationContainer, paintInvalidationState);
+ return renderObject->positionFromPaintInvalidationContainer(paintInvalidationContainer);
RenderLayerModelObject* transformedAncestor = paintInvalidationContainer->layer()->enclosingTransformedAncestor()->renderer();
if (!transformedAncestor)
- return renderObject->positionFromPaintInvalidationContainer(paintInvalidationContainer, paintInvalidationState);
+ return renderObject->positionFromPaintInvalidationContainer(paintInvalidationContainer);
- LayoutPoint point = renderObject->positionFromPaintInvalidationContainer(transformedAncestor, paintInvalidationState);
+ // If the transformedAncestor is actually the RenderView, we might get
+ // confused and think that we can use LayoutState. Ideally, we'd made
+ // LayoutState work for all composited layers as well, but until then
+ // we need to disable LayoutState for squashed layers.
+ ForceHorriblySlowRectMapping slowRectMapping(*transformedAncestor);
+
+ LayoutPoint point = renderObject->positionFromPaintInvalidationContainer(transformedAncestor);
point.moveBy(-paintInvalidationContainer->layer()->groupedMapping()->squashingOffsetFromTransformedAncestor());
return point;
}
void RenderLayer::mapRectToPaintBackingCoordinates(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect)
{
+
RenderLayer* paintInvalidationLayer = paintInvalidationContainer->layer();
if (!paintInvalidationLayer->groupedMapping()) {
rect.move(paintInvalidationLayer->compositedLayerMapping()->contentOffsetInCompositingLayer());
@@ -578,6 +585,12 @@ void RenderLayer::mapRectToPaintBackingCoordinates(const RenderLayerModelObject*
if (!transformedAncestor)
return;
+ // If the transformedAncestor is actually the RenderView, we might get
+ // confused and think that we can use LayoutState. Ideally, we'd made
+ // LayoutState work for all composited layers as well, but until then
+ // we need to disable LayoutState for squashed layers.
+ ForceHorriblySlowRectMapping slowRectMapping(*transformedAncestor);
+
// |repaintContainer| may have a local 2D transform on it, so take that into account when mapping into the space of the
// transformed ancestor.
rect = LayoutRect(paintInvalidationContainer->localToContainerQuad(FloatRect(rect), transformedAncestor).boundingBox());
@@ -585,10 +598,10 @@ void RenderLayer::mapRectToPaintBackingCoordinates(const RenderLayerModelObject*
rect.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromTransformedAncestor());
}
-void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderObject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState)
+void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderObject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect)
{
if (!paintInvalidationContainer->layer()->groupedMapping()) {
- renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, paintInvalidationState);
+ renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect);
return;
}
@@ -596,17 +609,17 @@ void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderOb
// layer. This is because all layers that squash together need to repaint w.r.t. a single container that is
// an ancestor of all of them, in order to properly take into account any local transforms etc.
// FIXME: remove this special-case code that works around the repainting code structure.
- renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, paintInvalidationState);
+ renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect);
RenderLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, rect);
}
-LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderObject, const RenderLayer* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState)
+LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderObject, const RenderLayer* paintInvalidationContainer)
{
if (!paintInvalidationContainer->groupedMapping())
return renderObject->computePaintInvalidationRect(paintInvalidationContainer->renderer());
LayoutRect rect = renderObject->clippedOverflowRectForPaintInvalidation(paintInvalidationContainer->renderer());
- mapRectToPaintInvalidationBacking(paintInvalidationContainer->renderer(), paintInvalidationContainer->renderer(), rect, paintInvalidationState);
+ mapRectToPaintInvalidationBacking(paintInvalidationContainer->renderer(), paintInvalidationContainer->renderer(), rect);
return rect;
}
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/RenderListBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698