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

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

Issue 2745563004: Reduce copying of local data structures in GeometryMapper and PaintLayerClipper. (Closed)
Patch Set: none Created 3 years, 9 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/PaintLayer.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index 439470c7a46c1a0ee9db1e1293e848e7ba853368..1ab53d95b8ebf5c2ffe54fdb50e2e6c5f4de2839 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -1646,9 +1646,10 @@ void PaintLayer::collectFragments(
overlayScrollbarClipBehavior);
if (respectOverflowClip == IgnoreOverflowClip)
clipRectsContext.setIgnoreOverflowClip();
- ancestorClipRect = enclosingPaginationLayer()
- ->clipper(geometryMapperOption)
- .backgroundClipRect(clipRectsContext);
+
+ enclosingPaginationLayer()
+ ->clipper(geometryMapperOption)
+ .calculateBackgroundClipRect(clipRectsContext, ancestorClipRect);
if (rootLayerIsInsidePaginationLayer)
ancestorClipRect.moveBy(
-rootLayer->visualOffsetFromAncestor(ancestorLayer));
@@ -1899,10 +1900,12 @@ PaintLayer* PaintLayer::hitTestLayer(
// Make sure the parent's clip rects have been calculated.
if (parent()) {
- ClipRect clipRect = clipper(PaintLayer::DoNotUseGeometryMapper)
- .backgroundClipRect(ClipRectsContext(
- rootLayer, clipRectsCacheSlot,
- ExcludeOverlayScrollbarSizeForHitTesting));
+ ClipRect clipRect;
+ clipper(PaintLayer::DoNotUseGeometryMapper)
+ .calculateBackgroundClipRect(
+ ClipRectsContext(rootLayer, clipRectsCacheSlot,
+ ExcludeOverlayScrollbarSizeForHitTesting),
+ clipRect);
// Go ahead and test the enclosing clip now.
if (!clipRect.intersects(hitTestLocation))
return nullptr;
@@ -2141,15 +2144,17 @@ PaintLayer* PaintLayer::hitTestTransformedLayerInFragments(
if (parent() != enclosingPaginationLayer()) {
enclosingPaginationLayer()->convertToLayerCoords(
rootLayer, offsetOfPaginationLayerFromRoot);
- LayoutRect parentClipRect =
- clipper(PaintLayer::DoNotUseGeometryMapper)
- .backgroundClipRect(ClipRectsContext(
- enclosingPaginationLayer(), clipRectsCacheSlot,
- ExcludeOverlayScrollbarSizeForHitTesting))
- .rect();
+
+ ClipRect parentClipRect;
+ clipper(PaintLayer::DoNotUseGeometryMapper)
+ .calculateBackgroundClipRect(
+ ClipRectsContext(enclosingPaginationLayer(), clipRectsCacheSlot,
+ ExcludeOverlayScrollbarSizeForHitTesting),
+ parentClipRect);
+
parentClipRect.moveBy(fragment.paginationOffset +
offsetOfPaginationLayerFromRoot);
- clipRect.intersect(parentClipRect);
+ clipRect.intersect(parentClipRect.rect());
}
if (!hitTestLocation.intersects(clipRect))

Powered by Google App Engine
This is Rietveld 408576698