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

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

Issue 2651253003: Revert of Fix shouldPaint issue when a composited floating iframe becomes non-self-painting (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 m_needsPaintPhaseDescendantOutlines(false), 150 m_needsPaintPhaseDescendantOutlines(false),
151 m_previousPaintPhaseDescendantOutlinesWasEmpty(false), 151 m_previousPaintPhaseDescendantOutlinesWasEmpty(false),
152 m_needsPaintPhaseFloat(false), 152 m_needsPaintPhaseFloat(false),
153 m_previousPaintPhaseFloatWasEmpty(false), 153 m_previousPaintPhaseFloatWasEmpty(false),
154 m_needsPaintPhaseDescendantBlockBackgrounds(false), 154 m_needsPaintPhaseDescendantBlockBackgrounds(false),
155 m_previousPaintPhaseDescendantBlockBackgroundsWasEmpty(false), 155 m_previousPaintPhaseDescendantBlockBackgroundsWasEmpty(false),
156 m_hasDescendantWithClipPath(false), 156 m_hasDescendantWithClipPath(false),
157 m_hasNonIsolatedDescendantWithBlendMode(false), 157 m_hasNonIsolatedDescendantWithBlendMode(false),
158 m_hasAncestorWithClipPath(false), 158 m_hasAncestorWithClipPath(false),
159 m_hasRootScrollerAsDescendant(false), 159 m_hasRootScrollerAsDescendant(false),
160 m_selfPaintingStatusChanged(false),
161 m_layoutObject(layoutObject), 160 m_layoutObject(layoutObject),
162 m_parent(0), 161 m_parent(0),
163 m_previous(0), 162 m_previous(0),
164 m_next(0), 163 m_next(0),
165 m_first(0), 164 m_first(0),
166 m_last(0), 165 m_last(0),
167 m_staticInlinePosition(0), 166 m_staticInlinePosition(0),
168 m_staticBlockPosition(0), 167 m_staticBlockPosition(0),
169 m_ancestorOverflowLayer(nullptr) { 168 m_ancestorOverflowLayer(nullptr) {
170 updateStackingNode(); 169 updateStackingNode();
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1510 } else { 1509 } else {
1511 // The ancestor layer is also inside the pagination layer, so we need to 1510 // The ancestor layer is also inside the pagination layer, so we need to
1512 // subtract the visual distance from the ancestor layer to the pagination 1511 // subtract the visual distance from the ancestor layer to the pagination
1513 // layer. 1512 // layer.
1514 offset.moveBy(-ancestorLayer->visualOffsetFromAncestor(paginationLayer)); 1513 offset.moveBy(-ancestorLayer->visualOffsetFromAncestor(paginationLayer));
1515 } 1514 }
1516 return offset; 1515 return offset;
1517 } 1516 }
1518 1517
1519 void PaintLayer::didUpdateNeedsCompositedScrolling() { 1518 void PaintLayer::didUpdateNeedsCompositedScrolling() {
1519 bool wasSelfPaintingLayer = isSelfPaintingLayer();
1520 updateSelfPaintingLayer(); 1520 updateSelfPaintingLayer();
1521
1522 // If the floating object becomes non-self-painting, so some ancestor should
1523 // paint it; if it becomes self-painting, it should paint itself and no
1524 // ancestor should paint it.
1525 if (wasSelfPaintingLayer != isSelfPaintingLayer() &&
1526 m_layoutObject->isFloating())
1527 LayoutBlockFlow::setAncestorShouldPaintFloatingObject(*layoutBox());
1521 } 1528 }
1522 1529
1523 void PaintLayer::updateStackingNode() { 1530 void PaintLayer::updateStackingNode() {
1524 DCHECK(!m_stackingNode); 1531 DCHECK(!m_stackingNode);
1525 if (requiresStackingNode()) 1532 if (requiresStackingNode())
1526 m_stackingNode = WTF::makeUnique<PaintLayerStackingNode>(this); 1533 m_stackingNode = WTF::makeUnique<PaintLayerStackingNode>(this);
1527 else 1534 else
1528 m_stackingNode = nullptr; 1535 m_stackingNode = nullptr;
1529 } 1536 }
1530 1537
(...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after
2779 LayoutRect childLocalRect(localRect); 2786 LayoutRect childLocalRect(localRect);
2780 childLayer->convertToLayerCoords(this, childOffset); 2787 childLayer->convertToLayerCoords(this, childOffset);
2781 childLocalRect.moveBy(-childOffset); 2788 childLocalRect.moveBy(-childOffset);
2782 2789
2783 if (childLayer->backgroundIsKnownToBeOpaqueInRect(childLocalRect)) 2790 if (childLayer->backgroundIsKnownToBeOpaqueInRect(childLocalRect))
2784 return true; 2791 return true;
2785 } 2792 }
2786 return false; 2793 return false;
2787 } 2794 }
2788 2795
2796 bool PaintLayer::isSelfPaintingLayerForIntrinsicOrScrollingReasons() const {
2797 return layoutObject()->layerTypeRequired() == NormalPaintLayer ||
2798 (m_scrollableArea && m_scrollableArea->hasOverlayScrollbars()) ||
2799 needsCompositedScrolling();
2800 }
2801
2789 bool PaintLayer::shouldBeSelfPaintingLayer() const { 2802 bool PaintLayer::shouldBeSelfPaintingLayer() const {
2790 if (layoutObject()->isLayoutPart() && 2803 if (layoutObject()->isLayoutPart() &&
2791 toLayoutPart(layoutObject())->requiresAcceleratedCompositing()) 2804 toLayoutPart(layoutObject())->requiresAcceleratedCompositing())
2792 return true; 2805 return true;
2806 return isSelfPaintingLayerForIntrinsicOrScrollingReasons();
2807 }
2793 2808
2794 return layoutObject()->layerTypeRequired() == NormalPaintLayer || 2809 bool PaintLayer::isSelfPaintingOnlyBecauseIsCompositedPart() const {
2795 (m_scrollableArea && m_scrollableArea->hasOverlayScrollbars()) || 2810 return shouldBeSelfPaintingLayer() &&
2796 needsCompositedScrolling(); 2811 !isSelfPaintingLayerForIntrinsicOrScrollingReasons();
2797 } 2812 }
2798 2813
2799 void PaintLayer::updateSelfPaintingLayer() { 2814 void PaintLayer::updateSelfPaintingLayer() {
2800 bool isSelfPaintingLayer = shouldBeSelfPaintingLayer(); 2815 bool isSelfPaintingLayer = shouldBeSelfPaintingLayer();
2801 if (this->isSelfPaintingLayer() == isSelfPaintingLayer) 2816 if (this->isSelfPaintingLayer() == isSelfPaintingLayer)
2802 return; 2817 return;
2803 2818
2804 m_isSelfPaintingLayer = isSelfPaintingLayer; 2819 m_isSelfPaintingLayer = isSelfPaintingLayer;
2805 m_selfPaintingStatusChanged = true;
2806 2820
2807 if (PaintLayer* parent = this->parent()) { 2821 if (PaintLayer* parent = this->parent()) {
2808 parent->dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 2822 parent->dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
2809 2823
2810 if (PaintLayer* enclosingSelfPaintingLayer = 2824 if (PaintLayer* enclosingSelfPaintingLayer =
2811 parent->enclosingSelfPaintingLayer()) { 2825 parent->enclosingSelfPaintingLayer()) {
2812 if (isSelfPaintingLayer) 2826 if (isSelfPaintingLayer)
2813 mergeNeedsPaintPhaseFlagsFrom(*enclosingSelfPaintingLayer); 2827 mergeNeedsPaintPhaseFlagsFrom(*enclosingSelfPaintingLayer);
2814 else 2828 else
2815 enclosingSelfPaintingLayer->mergeNeedsPaintPhaseFlagsFrom(*this); 2829 enclosingSelfPaintingLayer->mergeNeedsPaintPhaseFlagsFrom(*this);
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
3221 } 3235 }
3222 3236
3223 void showLayerTree(const blink::LayoutObject* layoutObject) { 3237 void showLayerTree(const blink::LayoutObject* layoutObject) {
3224 if (!layoutObject) { 3238 if (!layoutObject) {
3225 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; 3239 LOG(INFO) << "Cannot showLayerTree. Root is (nil)";
3226 return; 3240 return;
3227 } 3241 }
3228 showLayerTree(layoutObject->enclosingLayer()); 3242 showLayerTree(layoutObject->enclosingLayer());
3229 } 3243 }
3230 #endif 3244 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698