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

Side by Side 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, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1483 void PaintLayer::appendSingleFragmentIgnoringPagination(PaintLayerFragments& fra gments, const PaintLayer* rootLayer, const LayoutRect& dirtyRect, ClipRectsCache Slot clipRectsCacheSlot, OverlayScrollbarClipBehavior overlayScrollbarClipBehavi or, ShouldRespectOverflowClipType respectOverflowClip, const LayoutPoint* offset FromRoot, const LayoutSize& subPixelAccumulation) 1483 void PaintLayer::appendSingleFragmentIgnoringPagination(PaintLayerFragments& fra gments, const PaintLayer* rootLayer, const LayoutRect& dirtyRect, ClipRectsCache Slot clipRectsCacheSlot, OverlayScrollbarClipBehavior overlayScrollbarClipBehavi or, ShouldRespectOverflowClipType respectOverflowClip, const LayoutPoint* offset FromRoot, const LayoutSize& subPixelAccumulation)
1484 { 1484 {
1485 PaintLayerFragment fragment; 1485 PaintLayerFragment fragment;
1486 ClipRectsContext clipRectsContext(rootLayer, clipRectsCacheSlot, overlayScro llbarClipBehavior, subPixelAccumulation); 1486 ClipRectsContext clipRectsContext(rootLayer, clipRectsCacheSlot, overlayScro llbarClipBehavior, subPixelAccumulation);
1487 if (respectOverflowClip == IgnoreOverflowClip) 1487 if (respectOverflowClip == IgnoreOverflowClip)
1488 clipRectsContext.setIgnoreOverflowClip(); 1488 clipRectsContext.setIgnoreOverflowClip();
1489 clipper().calculateRects(clipRectsContext, dirtyRect, fragment.layerBounds, fragment.backgroundRect, fragment.foregroundRect, offsetFromRoot); 1489 clipper().calculateRects(clipRectsContext, dirtyRect, fragment.layerBounds, fragment.backgroundRect, fragment.foregroundRect, offsetFromRoot);
1490 fragments.append(fragment); 1490 fragments.append(fragment);
1491 } 1491 }
1492 1492
1493 bool PaintLayer::shouldFragmentCompositedBounds(const PaintLayer* compositingLay er) const
1494 {
1495 return enclosingPaginationLayer() && !compositingLayer->enclosingPaginationL ayer();
wkorman 2016/06/02 18:04:15 Considering whether a comment to explain this furt
chrishtr 2016/06/02 18:22:43 Done.
1496 }
1497
1493 void PaintLayer::collectFragments(PaintLayerFragments& fragments, const PaintLay er* rootLayer, const LayoutRect& dirtyRect, 1498 void PaintLayer::collectFragments(PaintLayerFragments& fragments, const PaintLay er* rootLayer, const LayoutRect& dirtyRect,
1494 ClipRectsCacheSlot clipRectsCacheSlot, OverlayScrollbarClipBehavior overlayS crollbarClipBehavior, ShouldRespectOverflowClipType respectOverflowClip, const L ayoutPoint* offsetFromRoot, 1499 ClipRectsCacheSlot clipRectsCacheSlot, OverlayScrollbarClipBehavior overlayS crollbarClipBehavior, ShouldRespectOverflowClipType respectOverflowClip, const L ayoutPoint* offsetFromRoot,
1495 const LayoutSize& subPixelAccumulation, const LayoutRect* layerBoundingBox) 1500 const LayoutSize& subPixelAccumulation, const LayoutRect* layerBoundingBox)
1496 { 1501 {
1497 if (!enclosingPaginationLayer()) { 1502 if (!enclosingPaginationLayer()) {
1498 // For unpaginated layers, there is only one fragment. 1503 // For unpaginated layers, there is only one fragment.
1499 appendSingleFragmentIgnoringPagination(fragments, rootLayer, dirtyRect, clipRectsCacheSlot, overlayScrollbarClipBehavior, respectOverflowClip, offsetFro mRoot, subPixelAccumulation); 1504 appendSingleFragmentIgnoringPagination(fragments, rootLayer, dirtyRect, clipRectsCacheSlot, overlayScrollbarClipBehavior, respectOverflowClip, offsetFro mRoot, subPixelAccumulation);
1500 return; 1505 return;
1501 } 1506 }
1502 1507
1508 if (!shouldFragmentCompositedBounds(rootLayer)) {
1509 appendSingleFragmentIgnoringPagination(fragments, rootLayer, dirtyRect, clipRectsCacheSlot, overlayScrollbarClipBehavior, respectOverflowClip, offsetFro mRoot, subPixelAccumulation);
1510 return;
1511 }
1512
1503 // Compute our offset within the enclosing pagination layer. 1513 // Compute our offset within the enclosing pagination layer.
1504 LayoutPoint offsetWithinPaginatedLayer; 1514 LayoutPoint offsetWithinPaginatedLayer;
1505 convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginatedLayer) ; 1515 convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginatedLayer) ;
1506 1516
1507 // Calculate clip rects relative to the enclosingPaginationLayer. The purpos e of this call is to determine our bounds clipped to intermediate 1517 // Calculate clip rects relative to the enclosingPaginationLayer. The purpos e of this call is to determine our bounds clipped to intermediate
1508 // layers between us and the pagination context. It's important to minimize the number of fragments we need to create and this helps with that. 1518 // layers between us and the pagination context. It's important to minimize the number of fragments we need to create and this helps with that.
1509 ClipRectsContext paginationClipRectsContext(enclosingPaginationLayer(), clip RectsCacheSlot, overlayScrollbarClipBehavior); 1519 ClipRectsContext paginationClipRectsContext(enclosingPaginationLayer(), clip RectsCacheSlot, overlayScrollbarClipBehavior);
1510 if (respectOverflowClip == IgnoreOverflowClip) 1520 if (respectOverflowClip == IgnoreOverflowClip)
1511 paginationClipRectsContext.setIgnoreOverflowClip(); 1521 paginationClipRectsContext.setIgnoreOverflowClip();
1512 LayoutRect layerBoundsInFlowThread; 1522 LayoutRect layerBoundsInFlowThread;
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
2246 2256
2247 // Only enlarge by the filter outsets if we know the filter is going to be rendered in software. 2257 // Only enlarge by the filter outsets if we know the filter is going to be rendered in software.
2248 // Accelerated filters will handle their own outsets. 2258 // Accelerated filters will handle their own outsets.
2249 if (paintsWithFilters()) 2259 if (paintsWithFilters())
2250 result = mapLayoutRectForFilter(result); 2260 result = mapLayoutRectForFilter(result);
2251 } 2261 }
2252 2262
2253 if (transform() && paintsWithTransform(GlobalPaintNormalPhase) && (this != a ncestorLayer || options == MaybeIncludeTransformForAncestorLayer)) 2263 if (transform() && paintsWithTransform(GlobalPaintNormalPhase) && (this != a ncestorLayer || options == MaybeIncludeTransformForAncestorLayer))
2254 result = transform()->mapRect(result); 2264 result = transform()->mapRect(result);
2255 2265
2256 if (enclosingPaginationLayer()) { 2266 if (shouldFragmentCompositedBounds(ancestorLayer)) {
2257 convertFromFlowThreadToVisualBoundingBoxInAncestor(ancestorLayer, result ); 2267 convertFromFlowThreadToVisualBoundingBoxInAncestor(ancestorLayer, result );
2258 return result; 2268 return result;
2259 } 2269 }
2260 LayoutPoint delta; 2270 LayoutPoint delta;
2261 convertToLayerCoords(ancestorLayer, delta); 2271 convertToLayerCoords(ancestorLayer, delta);
2262 result.moveBy(delta); 2272 result.moveBy(delta);
2263 return result; 2273 return result;
2264 } 2274 }
2265 2275
2266 CompositingState PaintLayer::compositingState() const 2276 CompositingState PaintLayer::compositingState() const
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
2916 2926
2917 void showLayerTree(const blink::LayoutObject* layoutObject) 2927 void showLayerTree(const blink::LayoutObject* layoutObject)
2918 { 2928 {
2919 if (!layoutObject) { 2929 if (!layoutObject) {
2920 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2930 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2921 return; 2931 return;
2922 } 2932 }
2923 showLayerTree(layoutObject->enclosingLayer()); 2933 showLayerTree(layoutObject->enclosingLayer());
2924 } 2934 }
2925 #endif 2935 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698