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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2502833002: Don't early out recursion into PaintLayerChildren when computing composited bounds. (Closed)
Patch Set: none Created 4 years, 1 month 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 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 2520 matching lines...) Expand 10 before | Expand all | Expand 10 after
2531 if (isRootLayer() && !needsCompositedScrolling()) 2531 if (isRootLayer() && !needsCompositedScrolling())
2532 return LayoutRect(m_layoutObject->view()->documentRect()); 2532 return LayoutRect(m_layoutObject->view()->documentRect());
2533 2533
2534 // The layer created for the LayoutFlowThread is just a helper for painting 2534 // The layer created for the LayoutFlowThread is just a helper for painting
2535 // and hit-testing, and should not contribute to the bounding box. The 2535 // and hit-testing, and should not contribute to the bounding box. The
2536 // LayoutMultiColumnSets will contribute the correct size for the layout 2536 // LayoutMultiColumnSets will contribute the correct size for the layout
2537 // content of the multicol container. 2537 // content of the multicol container.
2538 if (layoutObject()->isLayoutFlowThread()) 2538 if (layoutObject()->isLayoutFlowThread())
2539 return LayoutRect(); 2539 return LayoutRect();
2540 2540
2541 const_cast<PaintLayer*>(this)->stackingNode()->updateLayerListsIfNeeded();
2542
2541 // If there is a clip applied by an ancestor to this PaintLayer but below or 2543 // If there is a clip applied by an ancestor to this PaintLayer but below or
2542 // equal to |ancestorLayer|, use that clip as the bounds rather than the 2544 // equal to |ancestorLayer|, use that clip as the bounds rather than the
2543 // recursive bounding boxes, since the latter may be larger than the actual 2545 // recursive bounding boxes, since the latter may be larger than the actual
2544 // size. See https://bugs.webkit.org/show_bug.cgi?id=80372 for examples. 2546 // size. See https://bugs.webkit.org/show_bug.cgi?id=80372 for examples.
2545 LayoutRect result = clipper().localClipRect(ancestorLayer); 2547 LayoutRect result = clipper().localClipRect(ancestorLayer);
2546 // TODO(chrishtr): avoid converting to IntRect and back. 2548 // TODO(chrishtr): avoid converting to IntRect and back.
2547 if (result == LayoutRect(LayoutRect::infiniteIntRect())) { 2549 if (result == LayoutRect(LayoutRect::infiniteIntRect()))
2548 result = physicalBoundingBox(LayoutPoint()); 2550 result = physicalBoundingBox(LayoutPoint());
2549 2551
2550 const_cast<PaintLayer*>(this)->stackingNode()->updateLayerListsIfNeeded(); 2552 expandRectForStackingChildren(this, result, options);
2551 2553
2552 expandRectForStackingChildren(this, result, options); 2554 // Only enlarge by the filter outsets if we know the filter is going to be
2553 2555 // rendered in software. Accelerated filters will handle their own outsets.
2554 // Only enlarge by the filter outsets if we know the filter is going to be 2556 if (paintsWithFilters())
2555 // rendered in software. Accelerated filters will handle their own outsets. 2557 result = mapLayoutRectForFilter(result);
2556 if (paintsWithFilters())
2557 result = mapLayoutRectForFilter(result);
2558 }
2559 2558
2560 if (transform() && (options == IncludeTransformsAndCompositedChildLayers || 2559 if (transform() && (options == IncludeTransformsAndCompositedChildLayers ||
2561 ((paintsWithTransform(GlobalPaintNormalPhase) && 2560 ((paintsWithTransform(GlobalPaintNormalPhase) &&
2562 (this != ancestorLayer || 2561 (this != ancestorLayer ||
2563 options == MaybeIncludeTransformForAncestorLayer))))) 2562 options == MaybeIncludeTransformForAncestorLayer)))))
2564 result = transform()->mapRect(result); 2563 result = transform()->mapRect(result);
2565 2564
2566 if (shouldFragmentCompositedBounds(ancestorLayer)) { 2565 if (shouldFragmentCompositedBounds(ancestorLayer)) {
2567 convertFromFlowThreadToVisualBoundingBoxInAncestor(ancestorLayer, result); 2566 convertFromFlowThreadToVisualBoundingBoxInAncestor(ancestorLayer, result);
2568 return result; 2567 return result;
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
3229 } 3228 }
3230 3229
3231 void showLayerTree(const blink::LayoutObject* layoutObject) { 3230 void showLayerTree(const blink::LayoutObject* layoutObject) {
3232 if (!layoutObject) { 3231 if (!layoutObject) {
3233 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 3232 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
3234 return; 3233 return;
3235 } 3234 }
3236 showLayerTree(layoutObject->enclosingLayer()); 3235 showLayerTree(layoutObject->enclosingLayer());
3237 } 3236 }
3238 #endif 3237 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698