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

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

Issue 454643002: Route selection bounds updates through WebLayerTreeView (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revised Created 6 years, 3 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
Index: Source/core/rendering/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index 353bad4677cd95a7a07a53d4ff485fffc714fc54..d982cd346607579354f8b5b17163107534c3f1a3 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -523,17 +523,32 @@ void RenderLayer::updatePagination()
LayoutPoint RenderLayer::positionFromPaintInvalidationBacking(const RenderObject* renderObject, const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState)
{
+ // FIXME: Eventually we are going to unify coordinates in GraphicsLayer space.
if (!paintInvalidationContainer || !paintInvalidationContainer->layer()->groupedMapping())
- return renderObject->positionFromPaintInvalidationContainer(paintInvalidationContainer, paintInvalidationState);
+ return LayoutPoint(renderObject->localToContainerPoint(FloatPoint(), paintInvalidationContainer, 0, 0, paintInvalidationState));
- RenderLayerModelObject* transformedAncestor = paintInvalidationContainer->layer()->enclosingTransformedAncestor()->renderer();
- LayoutPoint point = renderObject->positionFromPaintInvalidationContainer(paintInvalidationContainer, paintInvalidationState);
+ FloatPoint point = renderObject->localToContainerPoint(FloatPoint(), paintInvalidationContainer, 0, 0, paintInvalidationState);
chrishtr 2014/09/18 23:30:55 This code is the same as line 528. Move the comput
trchen 2014/09/19 00:10:02 Acknowledged.
+ mapPointToPaintBackingCoordinates(paintInvalidationContainer, point);
+ return LayoutPoint(point);
+}
+
+void RenderLayer::mapPointToPaintBackingCoordinates(const RenderLayerModelObject* paintInvalidationContainer, FloatPoint& point)
+{
+ RenderLayer* paintInvalidationLayer = paintInvalidationContainer->layer();
+ if (!paintInvalidationLayer->groupedMapping()) {
+ point.move(paintInvalidationLayer->compositedLayerMapping()->contentOffsetInCompositingLayer());
+ return;
+ }
+
+ RenderLayerModelObject* transformedAncestor = paintInvalidationLayer->enclosingTransformedAncestor()->renderer();
if (!transformedAncestor)
- return point;
+ return;
+
+ // |paintInvalidationContainer| may have a local 2D transform on it, so take that into account when mapping into the space of the
+ // transformed ancestor.
+ point = paintInvalidationContainer->localToContainerPoint(point, transformedAncestor);
- point = LayoutPoint(paintInvalidationContainer->localToContainerPoint(point, transformedAncestor));
- point.moveBy(-paintInvalidationContainer->layer()->groupedMapping()->squashingOffsetFromTransformedAncestor());
- return point;
+ point.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromTransformedAncestor());
}
void RenderLayer::mapRectToPaintBackingCoordinates(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect)

Powered by Google App Engine
This is Rietveld 408576698