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

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

Issue 2028893002: Disallow fragmentation of composited content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 c0eaf2464ad1ce073a4a366da2c551bb78b58b94..e8298b6a75c22d627e35bf71ece225baed188a53 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -1490,6 +1490,12 @@ void PaintLayer::appendSingleFragmentIgnoringPagination(PaintLayerFragments& fra
fragments.append(fragment);
}
+bool PaintLayer::shouldFragmentCompositedBounds(const PaintLayer* compositingLayer) const
+{
+ // Composited layers may not be fragmented.
+ return enclosingPaginationLayer() && !compositingLayer->enclosingPaginationLayer();
+}
+
void PaintLayer::collectFragments(PaintLayerFragments& fragments, const PaintLayer* rootLayer, const LayoutRect& dirtyRect,
ClipRectsCacheSlot clipRectsCacheSlot, OverlayScrollbarClipBehavior overlayScrollbarClipBehavior, ShouldRespectOverflowClipType respectOverflowClip, const LayoutPoint* offsetFromRoot,
const LayoutSize& subPixelAccumulation, const LayoutRect* layerBoundingBox)
@@ -1500,6 +1506,11 @@ void PaintLayer::collectFragments(PaintLayerFragments& fragments, const PaintLay
return;
}
+ if (!shouldFragmentCompositedBounds(rootLayer)) {
+ appendSingleFragmentIgnoringPagination(fragments, rootLayer, dirtyRect, clipRectsCacheSlot, overlayScrollbarClipBehavior, respectOverflowClip, offsetFromRoot, subPixelAccumulation);
+ return;
+ }
+
// Compute our offset within the enclosing pagination layer.
LayoutPoint offsetWithinPaginatedLayer;
convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginatedLayer);
@@ -2253,7 +2264,7 @@ LayoutRect PaintLayer::boundingBoxForCompositing(const PaintLayer* ancestorLayer
if (transform() && paintsWithTransform(GlobalPaintNormalPhase) && (this != ancestorLayer || options == MaybeIncludeTransformForAncestorLayer))
result = transform()->mapRect(result);
- if (enclosingPaginationLayer()) {
+ if (shouldFragmentCompositedBounds(ancestorLayer)) {
convertFromFlowThreadToVisualBoundingBoxInAncestor(ancestorLayer, result);
return result;
}

Powered by Google App Engine
This is Rietveld 408576698