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

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

Issue 358913003: Get rid of one-off code in ScrollingCoordinator to handle graphics layer offsets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix. Created 6 years, 6 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/compositing/CompositedLayerMapping.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 0b2accd52907d91ad766b49a266b470164cf175d..d527762e5dcfe58dffdcd23260a92f0a65e73fc7 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -618,14 +618,16 @@ LayoutPoint RenderLayer::positionFromPaintInvalidationContainer(const RenderObje
return point;
}
-void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderObject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect)
+void RenderLayer::mapRectToPaintBackingCoordinates(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect)
{
- if (!paintInvalidationContainer->layer()->groupedMapping()) {
- renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect);
+
+ RenderLayer* paintInvalidationLayer = paintInvalidationContainer->layer();
+ if (!paintInvalidationLayer->groupedMapping()) {
+ rect.move(paintInvalidationLayer->compositedLayerMapping()->contentOffsetInCompositingLayer());
return;
}
- RenderLayerModelObject* transformedAncestor = paintInvalidationContainer->layer()->enclosingTransformedAncestor()->renderer();
+ RenderLayerModelObject* transformedAncestor = paintInvalidationLayer->enclosingTransformedAncestor()->renderer();
if (!transformedAncestor)
return;
@@ -635,17 +637,27 @@ void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderOb
// 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());
+
+ rect.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromTransformedAncestor());
+}
+
+void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderObject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect)
+{
+ if (!paintInvalidationContainer->layer()->groupedMapping()) {
+ renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect);
+ return;
+ }
+
// This code adjusts the repaint rectangle to be in the space of the transformed ancestor of the grouped (i.e. squashed)
// 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);
- // |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());
-
- rect.moveBy(-paintInvalidationContainer->layer()->groupedMapping()->squashingOffsetFromTransformedAncestor());
+ RenderLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, rect);
}
LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderObject, const RenderLayer* paintInvalidationContainer)
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/compositing/CompositedLayerMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698