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

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

Issue 2743733004: Revert of Reduce 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 09c7fea0c69a181f322a55459771b8bda6b7c644..3e2f9593c55f7ba2573bbfbb03a283ad09f74936 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();
-
- ClipRect clipRect;
- m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper)
- .calculateBackgroundClipRect(clipRectsContext, clipRect);
- IntRect parentClipRect = pixelSnappedIntRect(clipRect.rect());
+ LayoutRect unsnappedParentClipRect =
+ m_owningLayer.clipper(PaintLayer::DoNotUseGeometryMapper)
+ .backgroundClipRect(clipRectsContext)
+ .rect();
+ IntRect parentClipRect = pixelSnappedIntRect(unsnappedParentClipRect);
owningLayerIsClipped = parentClipRect != LayoutRect::infiniteIntRect();
// TODO(schenney): CSS clips are not applied to composited children, and
@@ -1152,23 +1152,20 @@
ClipRectsContext clipRectsContext(compositingContainer,
PaintingClipRectsIgnoringOverflowClip,
IgnoreOverlayScrollbarSize);
-
- 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()));
+ 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()));
// backgroundRect is relative to compositingContainer, so subtract
// snappedOffsetFromCompositedAncestor.X/snappedOffsetFromCompositedAncestor.Y
// to get back to local coords.
m_ancestorClippingLayer->setOffsetFromLayoutObject(
- snappedParentClipRect.location() - snappedOffsetFromCompositedAncestor);
+ parentClipRect.location() - snappedOffsetFromCompositedAncestor);
if (m_ancestorClippingMaskLayer) {
m_ancestorClippingMaskLayer->setOffsetFromLayoutObject(
@@ -1179,7 +1176,7 @@
// The primary layer is then parented in, and positioned relative to this
// clipping layer.
- graphicsLayerParentLocation = snappedParentClipRect.location();
+ graphicsLayerParentLocation = parentClipRect.location();
}
void CompositedLayerMapping::updateOverflowControlsHostLayerGeometry(
@@ -2879,18 +2876,17 @@
// these clip rects or otherwise optimizing.
ClipRectsContext clipRectsContext(ancestorPaintInfo->paintLayer,
UncachedClipRects);
- ClipRect parentClipRect;
- paintInfo.paintLayer->clipper(PaintLayer::DoNotUseGeometryMapper)
- .calculateBackgroundClipRect(clipRectsContext, parentClipRect);
-
- IntRect snappedParentClipRect(pixelSnappedIntRect(parentClipRect.rect()));
- DCHECK(snappedParentClipRect != LayoutRect::infiniteIntRect());
+ IntRect parentClipRect = pixelSnappedIntRect(
+ paintInfo.paintLayer->clipper(PaintLayer::DoNotUseGeometryMapper)
+ .backgroundClipRect(clipRectsContext)
+ .rect());
+ ASSERT(parentClipRect != LayoutRect::infiniteIntRect());
// Convert from ancestor to local coordinates.
IntSize ancestorToLocalOffset = paintInfo.offsetFromLayoutObject -
ancestorPaintInfo->offsetFromLayoutObject;
- snappedParentClipRect.move(ancestorToLocalOffset);
- return snappedParentClipRect;
+ parentClipRect.move(ancestorToLocalOffset);
+ return parentClipRect;
}
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