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 8f6ea8adb1b51c4cf258179d24198fdc5c5dca64..012a9cd267bc5adbbf70002e159816d6a6c1c66e 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp |
@@ -264,7 +264,7 @@ PaintLayerPainter::PaintResult PaintLayerPainter::paintLayerContents(GraphicsCon |
// Clip-path, like border radius, must not be applied to the contents of a composited-scrolling container. |
// It must, however, still be applied to the mask layer, so that the compositor can properly mask the |
// scrolling contents and scrollbars. |
- if (m_paintLayer.layoutObject()->hasClipPath() && (!m_paintLayer.needsCompositedScrolling() || (paintFlags & PaintLayerPaintingChildClippingMaskPhase))) { |
+ if (m_paintLayer.layoutObject()->hasClipPath() && (!m_paintLayer.needsCompositedScrolling() || (paintFlags & (PaintLayerPaintingChildClippingMaskPhase | PaintLayerPaintingAncestorClippingMaskPhase)))) { |
paintingInfo.ancestorHasClipPathClipping = true; |
LayoutRect referenceBox(m_paintLayer.boxForClipPath()); |
@@ -300,10 +300,14 @@ PaintLayerPainter::PaintResult PaintLayerPainter::paintLayerContents(GraphicsCon |
ClipRectsCacheSlot cacheSlot = (paintFlags & PaintLayerUncachedClipRects) ? UncachedClipRects : PaintingClipRects; |
// 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 |
- if (fragmentPolicy == ForceSingleFragment || RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
- m_paintLayer.appendSingleFragmentIgnoringPagination(layerFragments, localPaintingInfo.rootLayer, localPaintingInfo.paintDirtyRect, cacheSlot, IgnoreOverlayScrollbarSize, respectOverflowClip, &offsetFromRoot, localPaintingInfo.subPixelAccumulation); |
- else |
- m_paintLayer.collectFragments(layerFragments, localPaintingInfo.rootLayer, localPaintingInfo.paintDirtyRect, cacheSlot, IgnoreOverlayScrollbarSize, respectOverflowClip, &offsetFromRoot, localPaintingInfo.subPixelAccumulation); |
+ if (fragmentPolicy == ForceSingleFragment || RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
+ m_paintLayer.appendSingleFragmentIgnoringPagination(layerFragments, localPaintingInfo.rootLayer, localPaintingInfo.paintDirtyRect, |
+ cacheSlot, IgnoreOverlayScrollbarSize, respectOverflowClip, paintFlags & PaintLayerPaintingAncestorClippingMaskPhase, &offsetFromRoot, localPaintingInfo.subPixelAccumulation); |
+ } else { |
+ m_paintLayer.collectFragments(layerFragments, localPaintingInfo.rootLayer, localPaintingInfo.paintDirtyRect, |
+ cacheSlot, IgnoreOverlayScrollbarSize, respectOverflowClip, paintFlags & PaintLayerPaintingAncestorClippingMaskPhase, |
+ &offsetFromRoot, localPaintingInfo.subPixelAccumulation); |
+ } |
// TODO(trchen): Needs to adjust cull rect between transform spaces. https://crbug.com/593596 |
// Disables layer culling for SPv2 for now because the space of the cull rect doesn't match |
@@ -377,7 +381,7 @@ PaintLayerPainter::PaintResult PaintLayerPainter::paintLayerContents(GraphicsCon |
} // FilterPainter block |
bool shouldPaintMask = (paintFlags & PaintLayerPaintingCompositingMaskPhase) && shouldPaintContent && m_paintLayer.layoutObject()->hasMask() && !selectionOnly; |
- bool shouldPaintClippingMask = (paintFlags & PaintLayerPaintingChildClippingMaskPhase) && shouldPaintContent && !selectionOnly; |
+ bool shouldPaintClippingMask = (paintFlags & (PaintLayerPaintingChildClippingMaskPhase | PaintLayerPaintingAncestorClippingMaskPhase)) && shouldPaintContent && !selectionOnly; |
if (shouldPaintMask) |
paintMaskForFragments(layerFragments, context, localPaintingInfo, paintFlags); |
@@ -473,7 +477,7 @@ PaintLayerPainter::PaintResult PaintLayerPainter::paintLayerWithTransform(Graphi |
// which fragmentainers (e.g. columns) we need to visit. |
LayoutRect transformedExtent = PaintLayer::transparencyClipBox(&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(fragments, paintingInfo.rootLayer, paintingInfo.paintDirtyRect, cacheSlot, IgnoreOverlayScrollbarSize, respectOverflowClip, 0, paintingInfo.subPixelAccumulation, &transformedExtent); |
+ paginationLayer->collectFragments(fragments, paintingInfo.rootLayer, paintingInfo.paintDirtyRect, cacheSlot, IgnoreOverlayScrollbarSize, respectOverflowClip, false, 0, paintingInfo.subPixelAccumulation, &transformedExtent); |
} else { |
// We don't need to collect any fragments in the regular way here. We have already |
// calculated a clip rectangle for the ancestry if it was needed, and clipping this |
@@ -647,7 +651,6 @@ void PaintLayerPainter::paintFragmentWithPhase(PaintPhase phase, const PaintLaye |
clippingRule = LayerClipRecorder::IncludeSelfForBorderRadius; |
break; |
} |
- |
clipRecorder.emplace(context, *m_paintLayer.layoutObject(), clipType, clipRect, &paintingInfo, fragment.paginationOffset, paintFlags, clippingRule); |
} |
@@ -674,6 +677,7 @@ void PaintLayerPainter::paintFragmentWithPhase(PaintPhase phase, const PaintLaye |
PaintInfo paintInfo(context, pixelSnappedIntRect(newCullRect), phase, |
paintingInfo.getGlobalPaintFlags(), paintFlags, paintingInfo.rootLayer->layoutObject()); |
+ // TODO(schenney): This is the wrong object for painting AncestorClippingMask. |
m_paintLayer.layoutObject()->paint(paintInfo, paintOffset); |
} |