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

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: Unittest 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
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 String debugName() const; 102 String debugName() const;
103 103
104 LayoutBoxModelObject* layoutObject() const { return m_layoutObject; } 104 LayoutBoxModelObject* layoutObject() const { return m_layoutObject; }
105 LayoutBox* layoutBox() const { return m_layoutObject && m_layoutObject->isBo x() ? toLayoutBox(m_layoutObject) : 0; } 105 LayoutBox* layoutBox() const { return m_layoutObject && m_layoutObject->isBo x() ? toLayoutBox(m_layoutObject) : 0; }
106 DeprecatedPaintLayer* parent() const { return m_parent; } 106 DeprecatedPaintLayer* parent() const { return m_parent; }
107 DeprecatedPaintLayer* previousSibling() const { return m_previous; } 107 DeprecatedPaintLayer* previousSibling() const { return m_previous; }
108 DeprecatedPaintLayer* nextSibling() const { return m_next; } 108 DeprecatedPaintLayer* nextSibling() const { return m_next; }
109 DeprecatedPaintLayer* firstChild() const { return m_first; } 109 DeprecatedPaintLayer* firstChild() const { return m_first; }
110 DeprecatedPaintLayer* lastChild() const { return m_last; } 110 DeprecatedPaintLayer* lastChild() const { return m_last; }
111 111
112 const DeprecatedPaintLayer* compositingContainer() const; 112 // TODO(wangxianzhu): Find a better name for it. 'paintContainer' might be g ood but
113 // we can't use it for now because it conflicts with PaintInfo::paintContain er.
chrishtr 2015/08/27 04:29:48 How about stackingContainerForPaint()? With a comm
Xianzhu 2015/08/27 16:38:02 stackingContainerForPaint seems incomplete, becaus
114 DeprecatedPaintLayer* compositingContainer() const;
113 115
114 void addChild(DeprecatedPaintLayer* newChild, DeprecatedPaintLayer* beforeCh ild = 0); 116 void addChild(DeprecatedPaintLayer* newChild, DeprecatedPaintLayer* beforeCh ild = 0);
115 DeprecatedPaintLayer* removeChild(DeprecatedPaintLayer*); 117 DeprecatedPaintLayer* removeChild(DeprecatedPaintLayer*);
116 118
117 void removeOnlyThisLayer(); 119 void removeOnlyThisLayer();
118 void insertOnlyThisLayer(); 120 void insertOnlyThisLayer();
119 121
120 void styleChanged(StyleDifference, const ComputedStyle* oldStyle); 122 void styleChanged(StyleDifference, const ComputedStyle* oldStyle);
121 123
122 // FIXME: Many people call this function while it has out-of-date informatio n. 124 // FIXME: Many people call this function while it has out-of-date informatio n.
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 }; 532 };
531 533
532 enum TransparencyClipBoxMode { 534 enum TransparencyClipBoxMode {
533 DescendantsOfTransparencyClipBox, 535 DescendantsOfTransparencyClipBox,
534 RootOfTransparencyClipBox 536 RootOfTransparencyClipBox
535 }; 537 };
536 538
537 static LayoutRect transparencyClipBox(const DeprecatedPaintLayer*, const Dep recatedPaintLayer* rootLayer, TransparencyClipBoxBehavior transparencyBehavior, 539 static LayoutRect transparencyClipBox(const DeprecatedPaintLayer*, const Dep recatedPaintLayer* rootLayer, TransparencyClipBoxBehavior transparencyBehavior,
538 TransparencyClipBoxMode transparencyMode, GlobalPaintFlags = GlobalPaint NormalPhase); 540 TransparencyClipBoxMode transparencyMode, GlobalPaintFlags = GlobalPaint NormalPhase);
539 541
542 bool needsRepaint() const { return m_needsRepaint; }
543 void setNeedsRepaint();
544 void clearNeedsRepaint() { m_needsRepaint = false; }
545
540 private: 546 private:
541 // Bounding box in the coordinates of this layer. 547 // Bounding box in the coordinates of this layer.
542 LayoutRect logicalBoundingBox() const; 548 LayoutRect logicalBoundingBox() const;
543 549
544 bool hasOverflowControls() const; 550 bool hasOverflowControls() const;
545 551
546 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 552 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
547 553
548 // Returns true if the position changed. 554 // Returns true if the position changed.
549 bool updateLayerPosition(); 555 bool updateLayerPosition();
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 // Both updates the status, and returns true if descendants of this have 3d. 608 // Both updates the status, and returns true if descendants of this have 3d.
603 bool update3DTransformedDescendantStatus(); 609 bool update3DTransformedDescendantStatus();
604 610
605 void updateOrRemoveFilterClients(); 611 void updateOrRemoveFilterClients();
606 612
607 void updatePaginationRecursive(bool needsPaginationUpdate = false); 613 void updatePaginationRecursive(bool needsPaginationUpdate = false);
608 void clearPaginationRecursive(); 614 void clearPaginationRecursive();
609 615
610 void blockSelectionGapsBoundsChanged(); 616 void blockSelectionGapsBoundsChanged();
611 617
618 void markCompositingContainerChainForChildNeedsRepaint();
619
612 DeprecatedPaintLayerType m_layerType; 620 DeprecatedPaintLayerType m_layerType;
613 621
614 // Self-painting layer is an optimization where we avoid the heavy Layer pai nting 622 // Self-painting layer is an optimization where we avoid the heavy Layer pai nting
615 // machinery for a Layer allocated only to handle the overflow clip case. 623 // machinery for a Layer allocated only to handle the overflow clip case.
616 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov erflow-only concept. 624 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov erflow-only concept.
617 unsigned m_isSelfPaintingLayer : 1; 625 unsigned m_isSelfPaintingLayer : 1;
618 626
619 // If have no self-painting descendants, we don't have to walk our children during painting. This can lead to 627 // If have no self-painting descendants, we don't have to walk our children during painting. This can lead to
620 // significant savings, especially if the tree has lots of non-self-painting layers grouped together (e.g. table cells). 628 // significant savings, especially if the tree has lots of non-self-painting layers grouped together (e.g. table cells).
621 mutable unsigned m_hasSelfPaintingLayerDescendant : 1; 629 mutable unsigned m_hasSelfPaintingLayerDescendant : 1;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 // as opposed to the tree formed by the z-order and normal flow lists). 661 // as opposed to the tree formed by the z-order and normal flow lists).
654 unsigned m_hasNonCompositedChild : 1; 662 unsigned m_hasNonCompositedChild : 1;
655 663
656 // Should be for stacking contexts having unisolated blending descendants. 664 // Should be for stacking contexts having unisolated blending descendants.
657 unsigned m_shouldIsolateCompositedDescendants : 1; 665 unsigned m_shouldIsolateCompositedDescendants : 1;
658 666
659 // True if this layout layer just lost its grouped mapping due to the Compos itedDeprecatedPaintLayerMapping being destroyed, 667 // True if this layout layer just lost its grouped mapping due to the Compos itedDeprecatedPaintLayerMapping being destroyed,
660 // and we don't yet know to what graphics layer this Layer will be assigned. 668 // and we don't yet know to what graphics layer this Layer will be assigned.
661 unsigned m_lostGroupedMapping : 1; 669 unsigned m_lostGroupedMapping : 1;
662 670
671 unsigned m_needsRepaint : 1;
672
663 LayoutBoxModelObject* m_layoutObject; 673 LayoutBoxModelObject* m_layoutObject;
664 674
665 DeprecatedPaintLayer* m_parent; 675 DeprecatedPaintLayer* m_parent;
666 DeprecatedPaintLayer* m_previous; 676 DeprecatedPaintLayer* m_previous;
667 DeprecatedPaintLayer* m_next; 677 DeprecatedPaintLayer* m_next;
668 DeprecatedPaintLayer* m_first; 678 DeprecatedPaintLayer* m_first;
669 DeprecatedPaintLayer* m_last; 679 DeprecatedPaintLayer* m_last;
670 680
671 // Our current relative position offset. 681 // Our current relative position offset.
672 LayoutSize m_offsetForInFlowPosition; 682 LayoutSize m_offsetForInFlowPosition;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 729
720 } // namespace blink 730 } // namespace blink
721 731
722 #ifndef NDEBUG 732 #ifndef NDEBUG
723 // Outside the WebCore namespace for ease of invocation from gdb. 733 // Outside the WebCore namespace for ease of invocation from gdb.
724 void showLayerTree(const blink::DeprecatedPaintLayer*); 734 void showLayerTree(const blink::DeprecatedPaintLayer*);
725 void showLayerTree(const blink::LayoutObject*); 735 void showLayerTree(const blink::LayoutObject*);
726 #endif 736 #endif
727 737
728 #endif // Layer_h 738 #endif // Layer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698