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

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 // Composited layers may not be fragmented.
1496 return enclosingPaginationLayer() && !compositingLayer->enclosingPaginationL ayer();
1497 }
1498
1493 void PaintLayer::collectFragments(PaintLayerFragments& fragments, const PaintLay er* rootLayer, const LayoutRect& dirtyRect, 1499 void PaintLayer::collectFragments(PaintLayerFragments& fragments, const PaintLay er* rootLayer, const LayoutRect& dirtyRect,
1494 ClipRectsCacheSlot clipRectsCacheSlot, OverlayScrollbarClipBehavior overlayS crollbarClipBehavior, ShouldRespectOverflowClipType respectOverflowClip, const L ayoutPoint* offsetFromRoot, 1500 ClipRectsCacheSlot clipRectsCacheSlot, OverlayScrollbarClipBehavior overlayS crollbarClipBehavior, ShouldRespectOverflowClipType respectOverflowClip, const L ayoutPoint* offsetFromRoot,
1495 const LayoutSize& subPixelAccumulation, const LayoutRect* layerBoundingBox) 1501 const LayoutSize& subPixelAccumulation, const LayoutRect* layerBoundingBox)
1496 { 1502 {
1497 if (!enclosingPaginationLayer()) { 1503 if (!enclosingPaginationLayer()) {
1498 // For unpaginated layers, there is only one fragment. 1504 // For unpaginated layers, there is only one fragment.
1499 appendSingleFragmentIgnoringPagination(fragments, rootLayer, dirtyRect, clipRectsCacheSlot, overlayScrollbarClipBehavior, respectOverflowClip, offsetFro mRoot, subPixelAccumulation); 1505 appendSingleFragmentIgnoringPagination(fragments, rootLayer, dirtyRect, clipRectsCacheSlot, overlayScrollbarClipBehavior, respectOverflowClip, offsetFro mRoot, subPixelAccumulation);
1500 return; 1506 return;
1501 } 1507 }
1502 1508
1509 if (!shouldFragmentCompositedBounds(rootLayer)) {
1510 appendSingleFragmentIgnoringPagination(fragments, rootLayer, dirtyRect, clipRectsCacheSlot, overlayScrollbarClipBehavior, respectOverflowClip, offsetFro mRoot, subPixelAccumulation);
1511 return;
1512 }
1513
1503 // Compute our offset within the enclosing pagination layer. 1514 // Compute our offset within the enclosing pagination layer.
1504 LayoutPoint offsetWithinPaginatedLayer; 1515 LayoutPoint offsetWithinPaginatedLayer;
1505 convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginatedLayer) ; 1516 convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginatedLayer) ;
1506 1517
1507 // Calculate clip rects relative to the enclosingPaginationLayer. The purpos e of this call is to determine our bounds clipped to intermediate 1518 // 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. 1519 // 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); 1520 ClipRectsContext paginationClipRectsContext(enclosingPaginationLayer(), clip RectsCacheSlot, overlayScrollbarClipBehavior);
1510 if (respectOverflowClip == IgnoreOverflowClip) 1521 if (respectOverflowClip == IgnoreOverflowClip)
1511 paginationClipRectsContext.setIgnoreOverflowClip(); 1522 paginationClipRectsContext.setIgnoreOverflowClip();
1512 LayoutRect layerBoundsInFlowThread; 1523 LayoutRect layerBoundsInFlowThread;
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
2246 2257
2247 // Only enlarge by the filter outsets if we know the filter is going to be rendered in software. 2258 // 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. 2259 // Accelerated filters will handle their own outsets.
2249 if (paintsWithFilters()) 2260 if (paintsWithFilters())
2250 result = mapLayoutRectForFilter(result); 2261 result = mapLayoutRectForFilter(result);
2251 } 2262 }
2252 2263
2253 if (transform() && paintsWithTransform(GlobalPaintNormalPhase) && (this != a ncestorLayer || options == MaybeIncludeTransformForAncestorLayer)) 2264 if (transform() && paintsWithTransform(GlobalPaintNormalPhase) && (this != a ncestorLayer || options == MaybeIncludeTransformForAncestorLayer))
2254 result = transform()->mapRect(result); 2265 result = transform()->mapRect(result);
2255 2266
2256 if (enclosingPaginationLayer()) { 2267 if (shouldFragmentCompositedBounds(ancestorLayer)) {
2257 convertFromFlowThreadToVisualBoundingBoxInAncestor(ancestorLayer, result ); 2268 convertFromFlowThreadToVisualBoundingBoxInAncestor(ancestorLayer, result );
2258 return result; 2269 return result;
2259 } 2270 }
2260 LayoutPoint delta; 2271 LayoutPoint delta;
2261 convertToLayerCoords(ancestorLayer, delta); 2272 convertToLayerCoords(ancestorLayer, delta);
2262 result.moveBy(delta); 2273 result.moveBy(delta);
2263 return result; 2274 return result;
2264 } 2275 }
2265 2276
2266 CompositingState PaintLayer::compositingState() const 2277 CompositingState PaintLayer::compositingState() const
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
2916 2927
2917 void showLayerTree(const blink::LayoutObject* layoutObject) 2928 void showLayerTree(const blink::LayoutObject* layoutObject)
2918 { 2929 {
2919 if (!layoutObject) { 2930 if (!layoutObject) {
2920 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2931 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2921 return; 2932 return;
2922 } 2933 }
2923 showLayerTree(layoutObject->enclosingLayer()); 2934 showLayerTree(layoutObject->enclosingLayer());
2924 } 2935 }
2925 #endif 2936 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698