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

Side by Side Diff: Source/core/paint/DeprecatedPaintLayer.cpp

Issue 1149303002: Add a dirty bit for updateDescendantDependentFlags. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: try again. Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayer.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 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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 if (!paintInvalidationContainer->groupedMapping()) 644 if (!paintInvalidationContainer->groupedMapping())
645 return layoutObject->computePaintInvalidationRect(paintInvalidationConta iner->layoutObject(), paintInvalidationState); 645 return layoutObject->computePaintInvalidationRect(paintInvalidationConta iner->layoutObject(), paintInvalidationState);
646 646
647 LayoutRect rect = layoutObject->clippedOverflowRectForPaintInvalidation(pain tInvalidationContainer->layoutObject(), paintInvalidationState); 647 LayoutRect rect = layoutObject->clippedOverflowRectForPaintInvalidation(pain tInvalidationContainer->layoutObject(), paintInvalidationState);
648 mapRectToPaintBackingCoordinates(paintInvalidationContainer->layoutObject(), rect); 648 mapRectToPaintBackingCoordinates(paintInvalidationContainer->layoutObject(), rect);
649 return rect; 649 return rect;
650 } 650 }
651 651
652 void DeprecatedPaintLayer::dirtyVisibleContentStatus() 652 void DeprecatedPaintLayer::dirtyVisibleContentStatus()
653 { 653 {
654 compositor()->setNeedsUpdateDescendantDependentFlags();
654 m_visibleContentStatusDirty = true; 655 m_visibleContentStatusDirty = true;
655 if (parent()) 656 if (parent())
656 parent()->dirtyAncestorChainVisibleDescendantStatus(); 657 parent()->dirtyAncestorChainVisibleDescendantStatus();
657 } 658 }
658 659
659 void DeprecatedPaintLayer::potentiallyDirtyVisibleContentStatus(EVisibility visi bility) 660 void DeprecatedPaintLayer::potentiallyDirtyVisibleContentStatus(EVisibility visi bility)
660 { 661 {
661 if (m_visibleContentStatusDirty) 662 if (m_visibleContentStatusDirty)
662 return; 663 return;
663 if (hasVisibleContent() == (visibility == VISIBLE)) 664 if (hasVisibleContent() == (visibility == VISIBLE))
664 return; 665 return;
665 dirtyVisibleContentStatus(); 666 dirtyVisibleContentStatus();
666 } 667 }
667 668
668 void DeprecatedPaintLayer::dirtyAncestorChainVisibleDescendantStatus() 669 void DeprecatedPaintLayer::dirtyAncestorChainVisibleDescendantStatus()
669 { 670 {
671 compositor()->setNeedsUpdateDescendantDependentFlags();
672
670 for (DeprecatedPaintLayer* layer = this; layer; layer = layer->parent()) { 673 for (DeprecatedPaintLayer* layer = this; layer; layer = layer->parent()) {
671 if (layer->m_visibleDescendantStatusDirty) 674 if (layer->m_visibleDescendantStatusDirty)
672 break; 675 break;
673
674 layer->m_visibleDescendantStatusDirty = true; 676 layer->m_visibleDescendantStatusDirty = true;
675 } 677 }
676 } 678 }
677 679
678 // FIXME: this is quite brute-force. We could be more efficient if we were to 680 // FIXME: this is quite brute-force. We could be more efficient if we were to
679 // track state and update it as appropriate as changes are made in the layout tr ee. 681 // track state and update it as appropriate as changes are made in the layout tr ee.
680 void DeprecatedPaintLayer::updateScrollingStateAfterCompositingChange() 682 void DeprecatedPaintLayer::updateScrollingStateAfterCompositingChange()
681 { 683 {
682 TRACE_EVENT0("blink", "DeprecatedPaintLayer::updateScrollingStateAfterCompos itingChange"); 684 TRACE_EVENT0("blink", "DeprecatedPaintLayer::updateScrollingStateAfterCompos itingChange");
683 m_hasVisibleNonLayerContent = false; 685 m_hasVisibleNonLayerContent = false;
684 for (LayoutObject* r = layoutObject()->slowFirstChild(); r; r = r->nextSibli ng()) { 686 for (LayoutObject* r = layoutObject()->slowFirstChild(); r; r = r->nextSibli ng()) {
685 if (!r->hasLayer()) { 687 if (!r->hasLayer()) {
686 m_hasVisibleNonLayerContent = true; 688 m_hasVisibleNonLayerContent = true;
687 break; 689 break;
688 } 690 }
689 } 691 }
690 692
691 m_hasNonCompositedChild = false; 693 m_hasNonCompositedChild = false;
692 for (DeprecatedPaintLayer* child = firstChild(); child; child = child->nextS ibling()) { 694 for (DeprecatedPaintLayer* child = firstChild(); child; child = child->nextS ibling()) {
693 if (child->compositingState() == NotComposited) { 695 if (child->compositingState() == NotComposited) {
694 m_hasNonCompositedChild = true; 696 m_hasNonCompositedChild = true;
695 return; 697 return;
696 } 698 }
697 } 699 }
698 } 700 }
699 701
700 // The descendant-dependent flags system is badly broken because we clean dirty
701 // bits in upward tree walks, which means we need to call updateDescendantDepend entFlags
702 // at every node in the tree to fully clean all the dirty bits. While we'll in
703 // the process of fixing this issue, updateDescendantDependentFlagsForEntireSubt ree
704 // provides a big hammer for actually cleaning all the dirty bits in a subtree.
705 //
706 // FIXME: Remove this function once the descendant-dependent flags system keeps
707 // its dirty bits scoped to subtrees.
708 void DeprecatedPaintLayer::updateDescendantDependentFlagsForEntireSubtree()
709 {
710 updateDescendantDependentFlags();
711
712 for (DeprecatedPaintLayer* child = firstChild(); child; child = child->nextS ibling())
713 child->updateDescendantDependentFlagsForEntireSubtree();
714 }
715
716 void DeprecatedPaintLayer::updateDescendantDependentFlags() 702 void DeprecatedPaintLayer::updateDescendantDependentFlags()
717 { 703 {
718 if (m_visibleDescendantStatusDirty) { 704 if (m_visibleDescendantStatusDirty) {
719 m_hasVisibleDescendant = false; 705 m_hasVisibleDescendant = false;
720 706
721 for (DeprecatedPaintLayer* child = firstChild(); child; child = child->n extSibling()) { 707 for (DeprecatedPaintLayer* child = firstChild(); child; child = child->n extSibling()) {
722 child->updateDescendantDependentFlags(); 708 child->updateDescendantDependentFlags();
723 709
724 if (child->m_hasVisibleContent || child->m_hasVisibleDescendant) { 710 if (child->m_hasVisibleContent || child->m_hasVisibleDescendant) {
725 m_hasVisibleDescendant = true; 711 m_hasVisibleDescendant = true;
(...skipping 2253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2979 2965
2980 void showLayerTree(const blink::LayoutObject* layoutObject) 2966 void showLayerTree(const blink::LayoutObject* layoutObject)
2981 { 2967 {
2982 if (!layoutObject) { 2968 if (!layoutObject) {
2983 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2969 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2984 return; 2970 return;
2985 } 2971 }
2986 showLayerTree(layoutObject->enclosingLayer()); 2972 showLayerTree(layoutObject->enclosingLayer());
2987 } 2973 }
2988 #endif 2974 #endif
OLDNEW
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698