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

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

Issue 2601963002: Set needs paint property update when dirtying descendant-dependent properties. (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 | « no previous file | 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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 // of the "visible contents" of the parent, so we need to dirty it. 624 // of the "visible contents" of the parent, so we need to dirty it.
625 if (!isSelfPaintingLayer()) 625 if (!isSelfPaintingLayer())
626 parent()->dirtyVisibleContentStatus(); 626 parent()->dirtyVisibleContentStatus();
627 } 627 }
628 628
629 void PaintLayer::markAncestorChainForDescendantDependentFlagsUpdate() { 629 void PaintLayer::markAncestorChainForDescendantDependentFlagsUpdate() {
630 for (PaintLayer* layer = this; layer; layer = layer->parent()) { 630 for (PaintLayer* layer = this; layer; layer = layer->parent()) {
631 if (layer->m_needsDescendantDependentFlagsUpdate) 631 if (layer->m_needsDescendantDependentFlagsUpdate)
632 break; 632 break;
633 layer->m_needsDescendantDependentFlagsUpdate = true; 633 layer->m_needsDescendantDependentFlagsUpdate = true;
634
635 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
636 layer->layoutObject()->setNeedsPaintPropertyUpdate();
634 } 637 }
635 } 638 }
636 639
637 // FIXME: this is quite brute-force. We could be more efficient if we were to 640 // FIXME: this is quite brute-force. We could be more efficient if we were to
638 // track state and update it as appropriate as changes are made in the layout 641 // track state and update it as appropriate as changes are made in the layout
639 // tree. 642 // tree.
640 void PaintLayer::updateScrollingStateAfterCompositingChange() { 643 void PaintLayer::updateScrollingStateAfterCompositingChange() {
641 TRACE_EVENT0("blink", 644 TRACE_EVENT0("blink",
642 "PaintLayer::updateScrollingStateAfterCompositingChange"); 645 "PaintLayer::updateScrollingStateAfterCompositingChange");
643 m_isAllScrollingContentComposited = true; 646 m_isAllScrollingContentComposited = true;
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 } 1008 }
1006 1009
1007 void PaintLayer::setNeedsCompositingInputsUpdate() { 1010 void PaintLayer::setNeedsCompositingInputsUpdate() {
1008 setNeedsCompositingInputsUpdateInternal(); 1011 setNeedsCompositingInputsUpdateInternal();
1009 1012
1010 // TODO(chrishtr): These are a bit of a heavy hammer, because not all 1013 // TODO(chrishtr): These are a bit of a heavy hammer, because not all
1011 // things which require compositing inputs update require a descendant- 1014 // things which require compositing inputs update require a descendant-
1012 // dependent flags udpate. Reduce call sites after SPv2 launch allows 1015 // dependent flags udpate. Reduce call sites after SPv2 launch allows
1013 /// removal of CompositingInputsUpdater. 1016 /// removal of CompositingInputsUpdater.
1014 markAncestorChainForDescendantDependentFlagsUpdate(); 1017 markAncestorChainForDescendantDependentFlagsUpdate();
1015 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
1016 // This update is needed in order to re-compute sticky position constraints,
1017 // not for any other reason.
1018 layoutObject()->setNeedsPaintPropertyUpdate();
1019 }
1020 } 1018 }
1021 1019
1022 void PaintLayer::setNeedsCompositingInputsUpdateInternal() { 1020 void PaintLayer::setNeedsCompositingInputsUpdateInternal() {
1023 m_needsAncestorDependentCompositingInputsUpdate = true; 1021 m_needsAncestorDependentCompositingInputsUpdate = true;
1024 1022
1025 for (PaintLayer* current = this; 1023 for (PaintLayer* current = this;
1026 current && !current->m_childNeedsCompositingInputsUpdate; 1024 current && !current->m_childNeedsCompositingInputsUpdate;
1027 current = current->parent()) 1025 current = current->parent())
1028 current->m_childNeedsCompositingInputsUpdate = true; 1026 current->m_childNeedsCompositingInputsUpdate = true;
1029 1027
(...skipping 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after
3254 } 3252 }
3255 3253
3256 void showLayerTree(const blink::LayoutObject* layoutObject) { 3254 void showLayerTree(const blink::LayoutObject* layoutObject) {
3257 if (!layoutObject) { 3255 if (!layoutObject) {
3258 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; 3256 LOG(INFO) << "Cannot showLayerTree. Root is (nil)";
3259 return; 3257 return;
3260 } 3258 }
3261 showLayerTree(layoutObject->enclosingLayer()); 3259 showLayerTree(layoutObject->enclosingLayer());
3262 } 3260 }
3263 #endif 3261 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698