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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2741103005: Reland of duce copying of local data structures in GeometryMapper and PaintLayerClipper. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index 3e2f9593c55f7ba2573bbfbb03a283ad09f74936..09c7fea0c69a181f322a55459771b8bda6b7c644 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -555,11 +555,11 @@
ClipRectsContext clipRectsContext(compositingAncestor, UncachedClipRects,
IgnoreOverlayScrollbarSize);
clipRectsContext.setIgnoreOverflowClip();
- LayoutRect unsnappedParentClipRect =
- m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper)
- .backgroundClipRect(clipRectsContext)
- .rect();
- IntRect parentClipRect = pixelSnappedIntRect(unsnappedParentClipRect);
+
+ ClipRect clipRect;
+ m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper)
+ .calculateBackgroundClipRect(clipRectsContext, clipRect);
+ IntRect parentClipRect = pixelSnappedIntRect(clipRect.rect());
owningLayerIsClipped = parentClipRect != LayoutRect::infiniteIntRect();
// TODO(schenney): CSS clips are not applied to composited children, and
@@ -1152,20 +1152,23 @@
ClipRectsContext clipRectsContext(compositingContainer,
PaintingClipRectsIgnoringOverflowClip,
IgnoreOverlayScrollbarSize);
- IntRect parentClipRect = pixelSnappedIntRect(
- m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper)
- .backgroundClipRect(clipRectsContext)
- .rect());
- ASSERT(parentClipRect != LayoutRect::infiniteIntRect());
- m_ancestorClippingLayer->setPosition(
- FloatPoint(parentClipRect.location() - graphicsLayerParentLocation));
- m_ancestorClippingLayer->setSize(FloatSize(parentClipRect.size()));
+
+ ClipRect parentClipRect;
+ m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper)
+ .calculateBackgroundClipRect(clipRectsContext, parentClipRect);
+
+ IntRect snappedParentClipRect(pixelSnappedIntRect(parentClipRect.rect()));
+
+ DCHECK(snappedParentClipRect != LayoutRect::infiniteIntRect());
+ m_ancestorClippingLayer->setPosition(FloatPoint(
+ snappedParentClipRect.location() - graphicsLayerParentLocation));
+ m_ancestorClippingLayer->setSize(FloatSize(snappedParentClipRect.size()));
// backgroundRect is relative to compositingContainer, so subtract
// snappedOffsetFromCompositedAncestor.X/snappedOffsetFromCompositedAncestor.Y
// to get back to local coords.
m_ancestorClippingLayer->setOffsetFromLayoutObject(
- parentClipRect.location() - snappedOffsetFromCompositedAncestor);
+ snappedParentClipRect.location() - snappedOffsetFromCompositedAncestor);
if (m_ancestorClippingMaskLayer) {
m_ancestorClippingMaskLayer->setOffsetFromLayoutObject(
@@ -1176,7 +1179,7 @@
// The primary layer is then parented in, and positioned relative to this
// clipping layer.
- graphicsLayerParentLocation = parentClipRect.location();
+ graphicsLayerParentLocation = snappedParentClipRect.location();
}
void CompositedLayerMapping::updateOverflowControlsHostLayerGeometry(
@@ -2876,17 +2879,18 @@
// these clip rects or otherwise optimizing.
ClipRectsContext clipRectsContext(ancestorPaintInfo->paintLayer,
UncachedClipRects);
- IntRect parentClipRect = pixelSnappedIntRect(
- paintInfo.paintLayer->clipper(PaintLayer::DoNotUseGeometryMapper)
- .backgroundClipRect(clipRectsContext)
- .rect());
- ASSERT(parentClipRect != LayoutRect::infiniteIntRect());
+ ClipRect parentClipRect;
+ paintInfo.paintLayer->clipper(PaintLayer::DoNotUseGeometryMapper)
+ .calculateBackgroundClipRect(clipRectsContext, parentClipRect);
+
+ IntRect snappedParentClipRect(pixelSnappedIntRect(parentClipRect.rect()));
+ DCHECK(snappedParentClipRect != LayoutRect::infiniteIntRect());
// Convert from ancestor to local coordinates.
IntSize ancestorToLocalOffset = paintInfo.offsetFromLayoutObject -
ancestorPaintInfo->offsetFromLayoutObject;
- parentClipRect.move(ancestorToLocalOffset);
- return parentClipRect;
+ snappedParentClipRect.move(ancestorToLocalOffset);
+ return snappedParentClipRect;
}
void CompositedLayerMapping::doPaintTask(
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698