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

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

Issue 2671853003: [SPInvalidation] Use GeometryMapper in PaintLayerClipper for paint. (Closed)
Patch Set: Merge branch 'master' into paintlayerclipper Created 3 years, 10 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/PaintLayerPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index 9abd6514169a19bc020e86e0832c9e64351634e2..a496cf22535439c43d60e28b0f793e4805232293 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -227,8 +227,10 @@ static bool shouldRepaintSubsequence(
// Repaint if layer's clip changes.
if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
- ClipRects& clipRects = paintLayer.clipper().paintingClipRects(
- paintingInfo.rootLayer, respectOverflowClip, subpixelAccumulation);
+ ClipRects& clipRects =
+ paintLayer.clipper(PaintLayer::DoNotUseGeometryMapper)
+ .paintingClipRects(paintingInfo.rootLayer, respectOverflowClip,
+ subpixelAccumulation);
ClipRects* previousClipRects = paintLayer.previousPaintingClipRects();
if (&clipRects != previousClipRects &&
(!previousClipRects || clipRects != *previousClipRects)) {
@@ -437,6 +439,11 @@ PaintResult PaintLayerPainter::paintLayerContents(
localPaintingInfo.paintDirtyRect.moveBy(offsetToClipper);
}
+ PaintLayer::GeometryMapperOption geometryMapperOption =
+ PaintLayer::DoNotUseGeometryMapper;
+ if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
+ geometryMapperOption = PaintLayer::UseGeometryMapper;
+
// TODO(trchen): We haven't decided how to handle visual fragmentation with
// SPv2. Related thread
// https://groups.google.com/a/chromium.org/forum/#!topic/graphics-dev/81XuWFf-mxM
@@ -444,14 +451,14 @@ PaintResult PaintLayerPainter::paintLayerContents(
RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
paintLayerForFragments->appendSingleFragmentIgnoringPagination(
layerFragments, localPaintingInfo.rootLayer,
- localPaintingInfo.paintDirtyRect, cacheSlot,
+ localPaintingInfo.paintDirtyRect, cacheSlot, geometryMapperOption,
IgnoreOverlayScrollbarSize, respectOverflowClip, &offsetFromRoot,
localPaintingInfo.subPixelAccumulation);
} else if (isFixedPositionObjectInPagedMedia()) {
PaintLayerFragments singleFragment;
paintLayerForFragments->appendSingleFragmentIgnoringPagination(
singleFragment, localPaintingInfo.rootLayer,
- localPaintingInfo.paintDirtyRect, cacheSlot,
+ localPaintingInfo.paintDirtyRect, cacheSlot, geometryMapperOption,
IgnoreOverlayScrollbarSize, respectOverflowClip, &offsetFromRoot,
localPaintingInfo.subPixelAccumulation);
repeatFixedPositionObjectInPages(singleFragment[0], paintingInfo,
@@ -459,7 +466,7 @@ PaintResult PaintLayerPainter::paintLayerContents(
} else {
paintLayerForFragments->collectFragments(
layerFragments, localPaintingInfo.rootLayer,
- localPaintingInfo.paintDirtyRect, cacheSlot,
+ localPaintingInfo.paintDirtyRect, cacheSlot, geometryMapperOption,
IgnoreOverlayScrollbarSize, respectOverflowClip, &offsetFromRoot,
localPaintingInfo.subPixelAccumulation);
}
@@ -684,6 +691,11 @@ PaintResult PaintLayerPainter::paintLayerWithTransform(
// its parent.
PaintLayer* parentLayer = m_paintLayer.parent();
+ PaintLayer::GeometryMapperOption geometryMapperOption =
+ PaintLayer::DoNotUseGeometryMapper;
+ if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
+ geometryMapperOption = PaintLayer::UseGeometryMapper;
+
PaintLayer* paginationLayer = m_paintLayer.enclosingPaginationLayer();
PaintLayerFragments layerFragments;
bool isFixedPositionObjectInPagedMedia =
@@ -714,13 +726,15 @@ PaintResult PaintLayerPainter::paintLayerWithTransform(
&m_paintLayer, paginationLayer, PaintLayer::PaintingTransparencyClipBox,
PaintLayer::RootOfTransparencyClipBox,
paintingInfo.subPixelAccumulation, paintingInfo.getGlobalPaintFlags());
+
// FIXME: we don't check if paginationLayer is within
// paintingInfo.rootLayer
// here.
paginationLayer->collectFragments(
layerFragments, paintingInfo.rootLayer, paintingInfo.paintDirtyRect,
- cacheSlot, IgnoreOverlayScrollbarSize, respectOverflowClip, nullptr,
- paintingInfo.subPixelAccumulation, &transformedExtent);
+ cacheSlot, geometryMapperOption, IgnoreOverlayScrollbarSize,
+ respectOverflowClip, nullptr, paintingInfo.subPixelAccumulation,
+ &transformedExtent);
}
Optional<DisplayItemCacheSkipper> cacheSkipper;
@@ -739,8 +753,8 @@ PaintResult PaintLayerPainter::paintLayerWithTransform(
if (shouldRespectOverflowClip(paintFlags, m_paintLayer.layoutObject()) ==
IgnoreOverflowClip)
clipRectsContext.setIgnoreOverflowClip();
- ancestorBackgroundClipRect =
- m_paintLayer.clipper().backgroundClipRect(clipRectsContext);
+ ancestorBackgroundClipRect = m_paintLayer.clipper(geometryMapperOption)
+ .backgroundClipRect(clipRectsContext);
}
}

Powered by Google App Engine
This is Rietveld 408576698