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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp

Issue 2623823002: Rename and change parameter type of some GeometryMapper methods (Closed)
Patch Set: Swap local and ancestor parameters in ancestorToLocalRect(). Created 3 years, 11 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: third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
index af5149f80469b94eaac9903df786c583cf5a18c7..600c75a3d0a78865a2c3fde9927bec84ffda81ff 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
@@ -216,15 +216,18 @@ LayoutRect PaintLayerClipper::localClipRect(
// The rect now needs to be transformed to the local space of this
// PaintLayer.
bool success = false;
- FloatRect clippedRectInLocalSpace =
- m_geometryMapper->mapRectToDestinationSpace(
- FloatRect(clipRect.rect()), *clippingRootLayer->layoutObject()
+ const auto* clipRootLayerTransform = clippingRootLayer->layoutObject()
->paintProperties()
- ->localBorderBoxProperties(),
- *m_layer.layoutObject()
- ->paintProperties()
- ->localBorderBoxProperties(),
- success);
+ ->localBorderBoxProperties()
+ ->transform();
+ const auto* layerTransform = m_layer.layoutObject()
+ ->paintProperties()
+ ->localBorderBoxProperties()
+ ->transform();
+ FloatRect clippedRectInLocalSpace =
+ m_geometryMapper->sourceToDestinationRect(FloatRect(clipRect.rect()),
+ clipRootLayerTransform,
+ layerTransform, success);
DCHECK(success);
return LayoutRect(clippedRectInLocalSpace);
@@ -259,16 +262,19 @@ void PaintLayerClipper::mapLocalToRootWithGeometryMapper(
DCHECK(m_geometryMapper);
bool success;
- const auto* layerBorderBoxProperties =
- m_layer.layoutObject()->paintProperties()->localBorderBoxProperties();
+ const auto* layerTransform = m_layer.layoutObject()
+ ->paintProperties()
+ ->localBorderBoxProperties()
+ ->transform();
+ const auto* rootTransform = context.rootLayer->layoutObject()
+ ->paintProperties()
+ ->localBorderBoxProperties()
+ ->transform();
+
FloatRect localRect(layoutRect);
localRect.moveBy(FloatPoint(m_layer.layoutObject()->paintOffset()));
-
- layoutRect = LayoutRect(m_geometryMapper->mapRectToDestinationSpace(
- localRect, *layerBorderBoxProperties, *context.rootLayer->layoutObject()
- ->paintProperties()
- ->localBorderBoxProperties(),
- success));
+ layoutRect = LayoutRect(m_geometryMapper->sourceToDestinationRect(
+ localRect, layerTransform, rootTransform, success));
DCHECK(success);
}
@@ -452,7 +458,7 @@ ClipRect PaintLayerClipper::clipRectWithGeometryMapper(
destinationPropertyTreeState.setClip(ancestorProperties->overflowClip());
}
FloatRect clippedRectInRootLayerSpace =
- m_geometryMapper->mapToVisualRectInDestinationSpace(
+ m_geometryMapper->sourceToDestinationVisualRect(
FloatRect(source), propertyTreeState, destinationPropertyTreeState,
success);
DCHECK(success);

Powered by Google App Engine
This is Rietveld 408576698