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

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

Issue 1294233004: Subtree caching implementation in blink-core (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Don't mark non-self-painting layers for needsRepaint Created 5 years, 3 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/layout/LayoutObject.cpp ('k') | Source/core/paint/DeprecatedPaintLayer.cpp » ('j') | 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) 2003, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Intel Corporation. All rights reserved. 3 * Copyright (C) 2013 Intel Corporation. All rights 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 String debugName() const; 104 String debugName() const;
105 105
106 LayoutBoxModelObject* layoutObject() const { return m_layoutObject; } 106 LayoutBoxModelObject* layoutObject() const { return m_layoutObject; }
107 LayoutBox* layoutBox() const { return m_layoutObject && m_layoutObject->isBo x() ? toLayoutBox(m_layoutObject) : 0; } 107 LayoutBox* layoutBox() const { return m_layoutObject && m_layoutObject->isBo x() ? toLayoutBox(m_layoutObject) : 0; }
108 DeprecatedPaintLayer* parent() const { return m_parent; } 108 DeprecatedPaintLayer* parent() const { return m_parent; }
109 DeprecatedPaintLayer* previousSibling() const { return m_previous; } 109 DeprecatedPaintLayer* previousSibling() const { return m_previous; }
110 DeprecatedPaintLayer* nextSibling() const { return m_next; } 110 DeprecatedPaintLayer* nextSibling() const { return m_next; }
111 DeprecatedPaintLayer* firstChild() const { return m_first; } 111 DeprecatedPaintLayer* firstChild() const { return m_first; }
112 DeprecatedPaintLayer* lastChild() const { return m_last; } 112 DeprecatedPaintLayer* lastChild() const { return m_last; }
113 113
114 const DeprecatedPaintLayer* compositingContainer() const; 114 // TODO(wangxianzhu): Find a better name for it. 'paintContainer' might be g ood but
115 // we can't use it for now because it conflicts with PaintInfo::paintContain er.
116 DeprecatedPaintLayer* compositingContainer() const;
115 117
116 void addChild(DeprecatedPaintLayer* newChild, DeprecatedPaintLayer* beforeCh ild = 0); 118 void addChild(DeprecatedPaintLayer* newChild, DeprecatedPaintLayer* beforeCh ild = 0);
117 DeprecatedPaintLayer* removeChild(DeprecatedPaintLayer*); 119 DeprecatedPaintLayer* removeChild(DeprecatedPaintLayer*);
118 120
119 void removeOnlyThisLayer(); 121 void removeOnlyThisLayer();
120 void insertOnlyThisLayer(); 122 void insertOnlyThisLayer();
121 123
122 void styleChanged(StyleDifference, const ComputedStyle* oldStyle); 124 void styleChanged(StyleDifference, const ComputedStyle* oldStyle);
123 125
124 // FIXME: Many people call this function while it has out-of-date informatio n. 126 // FIXME: Many people call this function while it has out-of-date informatio n.
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 }; 540 };
539 541
540 enum TransparencyClipBoxMode { 542 enum TransparencyClipBoxMode {
541 DescendantsOfTransparencyClipBox, 543 DescendantsOfTransparencyClipBox,
542 RootOfTransparencyClipBox 544 RootOfTransparencyClipBox
543 }; 545 };
544 546
545 static LayoutRect transparencyClipBox(const DeprecatedPaintLayer*, const Dep recatedPaintLayer* rootLayer, TransparencyClipBoxBehavior transparencyBehavior, 547 static LayoutRect transparencyClipBox(const DeprecatedPaintLayer*, const Dep recatedPaintLayer* rootLayer, TransparencyClipBoxBehavior transparencyBehavior,
546 TransparencyClipBoxMode transparencyMode, GlobalPaintFlags = GlobalPaint NormalPhase); 548 TransparencyClipBoxMode transparencyMode, GlobalPaintFlags = GlobalPaint NormalPhase);
547 549
550 bool needsRepaint() const { return m_needsRepaint; }
551 void setNeedsRepaint();
552 void clearNeedsRepaint() { m_needsRepaint = false; }
553
548 private: 554 private:
549 // Bounding box in the coordinates of this layer. 555 // Bounding box in the coordinates of this layer.
550 LayoutRect logicalBoundingBox() const; 556 LayoutRect logicalBoundingBox() const;
551 557
552 bool hasOverflowControls() const; 558 bool hasOverflowControls() const;
553 559
554 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 560 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
555 561
556 // Returns true if the position changed. 562 // Returns true if the position changed.
557 bool updateLayerPosition(); 563 bool updateLayerPosition();
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 // Both updates the status, and returns true if descendants of this have 3d. 616 // Both updates the status, and returns true if descendants of this have 3d.
611 bool update3DTransformedDescendantStatus(); 617 bool update3DTransformedDescendantStatus();
612 618
613 void updateOrRemoveFilterClients(); 619 void updateOrRemoveFilterClients();
614 620
615 void updatePaginationRecursive(bool needsPaginationUpdate = false); 621 void updatePaginationRecursive(bool needsPaginationUpdate = false);
616 void clearPaginationRecursive(); 622 void clearPaginationRecursive();
617 623
618 void blockSelectionGapsBoundsChanged(); 624 void blockSelectionGapsBoundsChanged();
619 625
626 void markCompositingContainerChainForNeedsRepaint();
627
620 DeprecatedPaintLayerType m_layerType; 628 DeprecatedPaintLayerType m_layerType;
621 629
622 // Self-painting layer is an optimization where we avoid the heavy Layer pai nting 630 // Self-painting layer is an optimization where we avoid the heavy Layer pai nting
623 // machinery for a Layer allocated only to handle the overflow clip case. 631 // machinery for a Layer allocated only to handle the overflow clip case.
624 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov erflow-only concept. 632 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov erflow-only concept.
625 unsigned m_isSelfPaintingLayer : 1; 633 unsigned m_isSelfPaintingLayer : 1;
626 634
627 // If have no self-painting descendants, we don't have to walk our children during painting. This can lead to 635 // If have no self-painting descendants, we don't have to walk our children during painting. This can lead to
628 // significant savings, especially if the tree has lots of non-self-painting layers grouped together (e.g. table cells). 636 // significant savings, especially if the tree has lots of non-self-painting layers grouped together (e.g. table cells).
629 mutable unsigned m_hasSelfPaintingLayerDescendant : 1; 637 mutable unsigned m_hasSelfPaintingLayerDescendant : 1;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 // as opposed to the tree formed by the z-order and normal flow lists). 669 // as opposed to the tree formed by the z-order and normal flow lists).
662 unsigned m_hasNonCompositedChild : 1; 670 unsigned m_hasNonCompositedChild : 1;
663 671
664 // Should be for stacking contexts having unisolated blending descendants. 672 // Should be for stacking contexts having unisolated blending descendants.
665 unsigned m_shouldIsolateCompositedDescendants : 1; 673 unsigned m_shouldIsolateCompositedDescendants : 1;
666 674
667 // True if this layout layer just lost its grouped mapping due to the Compos itedDeprecatedPaintLayerMapping being destroyed, 675 // True if this layout layer just lost its grouped mapping due to the Compos itedDeprecatedPaintLayerMapping being destroyed,
668 // and we don't yet know to what graphics layer this Layer will be assigned. 676 // and we don't yet know to what graphics layer this Layer will be assigned.
669 unsigned m_lostGroupedMapping : 1; 677 unsigned m_lostGroupedMapping : 1;
670 678
679 unsigned m_needsRepaint : 1;
680
671 LayoutBoxModelObject* m_layoutObject; 681 LayoutBoxModelObject* m_layoutObject;
672 682
673 DeprecatedPaintLayer* m_parent; 683 DeprecatedPaintLayer* m_parent;
674 DeprecatedPaintLayer* m_previous; 684 DeprecatedPaintLayer* m_previous;
675 DeprecatedPaintLayer* m_next; 685 DeprecatedPaintLayer* m_next;
676 DeprecatedPaintLayer* m_first; 686 DeprecatedPaintLayer* m_first;
677 DeprecatedPaintLayer* m_last; 687 DeprecatedPaintLayer* m_last;
678 688
679 // Our current relative position offset. 689 // Our current relative position offset.
680 LayoutSize m_offsetForInFlowPosition; 690 LayoutSize m_offsetForInFlowPosition;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 737
728 } // namespace blink 738 } // namespace blink
729 739
730 #ifndef NDEBUG 740 #ifndef NDEBUG
731 // Outside the WebCore namespace for ease of invocation from gdb. 741 // Outside the WebCore namespace for ease of invocation from gdb.
732 void showLayerTree(const blink::DeprecatedPaintLayer*); 742 void showLayerTree(const blink::DeprecatedPaintLayer*);
733 void showLayerTree(const blink::LayoutObject*); 743 void showLayerTree(const blink::LayoutObject*);
734 #endif 744 #endif
735 745
736 #endif // Layer_h 746 #endif // Layer_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutObject.cpp ('k') | Source/core/paint/DeprecatedPaintLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698