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

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

Issue 1188363002: Compute the normal flow list on the fly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix reverse iterator (OOPS). Created 5 years, 6 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 bool zOrderListsDirty() const { return m_zOrderListsDirty; } 74 bool zOrderListsDirty() const { return m_zOrderListsDirty; }
75 void dirtyZOrderLists(); 75 void dirtyZOrderLists();
76 void updateZOrderLists(); 76 void updateZOrderLists();
77 void clearZOrderLists(); 77 void clearZOrderLists();
78 void dirtyStackingContextZOrderLists(); 78 void dirtyStackingContextZOrderLists();
79 79
80 bool hasPositiveZOrderList() const { return posZOrderList() && posZOrderList ()->size(); } 80 bool hasPositiveZOrderList() const { return posZOrderList() && posZOrderList ()->size(); }
81 bool hasNegativeZOrderList() const { return negZOrderList() && negZOrderList ()->size(); } 81 bool hasNegativeZOrderList() const { return negZOrderList() && negZOrderList ()->size(); }
82 82
83 // FIXME: should check for dirtiness here?
84 bool isNormalFlowOnly() const { return !isTreatedAsStackingContextForPaintin g(); }
85 bool isTreatedAsStackingContextForPainting() const { return m_isTreatedAsSta ckingContextForPainting; } 83 bool isTreatedAsStackingContextForPainting() const { return m_isTreatedAsSta ckingContextForPainting; }
86 void updateIsTreatedAsStackingContextForPainting(); 84 void updateIsTreatedAsStackingContextForPainting();
87 bool normalFlowListDirty() const { return m_normalFlowListDirty; }
88 void dirtyNormalFlowList();
89 85
90 void updateStackingNodesAfterStyleChange(const ComputedStyle* oldStyle); 86 void updateStackingNodesAfterStyleChange(const ComputedStyle* oldStyle);
91 87
92 DeprecatedPaintLayerStackingNode* ancestorStackingContextNode() const; 88 DeprecatedPaintLayerStackingNode* ancestorStackingContextNode() const;
93 89
94 DeprecatedPaintLayer* layer() const { return m_layer; } 90 DeprecatedPaintLayer* layer() const { return m_layer; }
95 91
96 #if ENABLE(ASSERT) 92 #if ENABLE(ASSERT)
97 bool layerListMutationAllowed() const { return m_layerListMutationAllowed; } 93 bool layerListMutationAllowed() const { return m_layerListMutationAllowed; }
98 void setLayerListMutationAllowed(bool flag) { m_layerListMutationAllowed = f lag; } 94 void setLayerListMutationAllowed(bool flag) { m_layerListMutationAllowed = f lag; }
99 #endif 95 #endif
100 96
101 private: 97 private:
102 friend class DeprecatedPaintLayerStackingNodeIterator; 98 friend class DeprecatedPaintLayerStackingNodeIterator;
103 friend class DeprecatedPaintLayerStackingNodeReverseIterator; 99 friend class DeprecatedPaintLayerStackingNodeReverseIterator;
104 friend class LayoutTreeAsText; 100 friend class LayoutTreeAsText;
105 101
106 Vector<DeprecatedPaintLayerStackingNode*>* posZOrderList() const 102 Vector<DeprecatedPaintLayerStackingNode*>* posZOrderList() const
107 { 103 {
108 ASSERT(!m_zOrderListsDirty); 104 ASSERT(!m_zOrderListsDirty);
109 ASSERT(isStackingContext() || !m_posZOrderList); 105 ASSERT(isStackingContext() || !m_posZOrderList);
110 return m_posZOrderList.get(); 106 return m_posZOrderList.get();
111 } 107 }
112 108
113 Vector<DeprecatedPaintLayerStackingNode*>* normalFlowList() const
114 {
115 ASSERT(!m_normalFlowListDirty);
116 return m_normalFlowList.get();
117 }
118
119 Vector<DeprecatedPaintLayerStackingNode*>* negZOrderList() const 109 Vector<DeprecatedPaintLayerStackingNode*>* negZOrderList() const
120 { 110 {
121 ASSERT(!m_zOrderListsDirty); 111 ASSERT(!m_zOrderListsDirty);
122 ASSERT(isStackingContext() || !m_negZOrderList); 112 ASSERT(isStackingContext() || !m_negZOrderList);
123 return m_negZOrderList.get(); 113 return m_negZOrderList.get();
124 } 114 }
125 115
126 void rebuildZOrderLists(); 116 void rebuildZOrderLists();
127 void collectLayers(OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>>& posZOr derList, OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>>& negZOrderList); 117 void collectLayers(OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>>& posZOr derList, OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>>& negZOrderList);
128 118
129 #if ENABLE(ASSERT) 119 #if ENABLE(ASSERT)
130 bool isInStackingParentZOrderLists() const; 120 bool isInStackingParentZOrderLists() const;
131 bool isInStackingParentNormalFlowList() const;
132 void updateStackingParentForZOrderLists(DeprecatedPaintLayerStackingNode* st ackingParent); 121 void updateStackingParentForZOrderLists(DeprecatedPaintLayerStackingNode* st ackingParent);
133 void updateStackingParentForNormalFlowList(DeprecatedPaintLayerStackingNode* stackingParent);
134 void setStackingParent(DeprecatedPaintLayerStackingNode* stackingParent) { m _stackingParent = stackingParent; } 122 void setStackingParent(DeprecatedPaintLayerStackingNode* stackingParent) { m _stackingParent = stackingParent; }
135 #endif 123 #endif
136 124
137 bool shouldBeTreatedAsStackingContextForPainting() const { return layoutObje ct()->style()->isTreatedAsStackingContextForPainting(); } 125 bool shouldBeTreatedAsStackingContextForPainting() const { return layoutObje ct()->style()->isTreatedAsStackingContextForPainting(); }
138 126
139 void updateNormalFlowList();
140
141 bool isDirtyStackingContext() const { return m_zOrderListsDirty && isStackin gContext(); } 127 bool isDirtyStackingContext() const { return m_zOrderListsDirty && isStackin gContext(); }
142 128
143 DeprecatedPaintLayerCompositor* compositor() const; 129 DeprecatedPaintLayerCompositor* compositor() const;
144 // We can't return a LayoutBox as LayoutInline can be a stacking context. 130 // We can't return a LayoutBox as LayoutInline can be a stacking context.
145 LayoutBoxModelObject* layoutObject() const; 131 LayoutBoxModelObject* layoutObject() const;
146 132
147 DeprecatedPaintLayer* m_layer; 133 DeprecatedPaintLayer* m_layer;
148 134
149 // m_posZOrderList holds a sorted list of all the descendant nodes within 135 // m_posZOrderList holds a sorted list of all the descendant nodes within
150 // that have z-indices of 0 or greater (auto will count as 0). 136 // that have z-indices of 0 or greater (auto will count as 0).
151 // m_negZOrderList holds descendants within our stacking context with 137 // m_negZOrderList holds descendants within our stacking context with
152 // negative z-indices. 138 // negative z-indices.
153 OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>> m_posZOrderList; 139 OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>> m_posZOrderList;
154 OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>> m_negZOrderList; 140 OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>> m_negZOrderList;
155 141
156 // This list contains child nodes that cannot create stacking contexts.
157 OwnPtr<Vector<DeprecatedPaintLayerStackingNode*>> m_normalFlowList;
158
159 unsigned m_zOrderListsDirty : 1; 142 unsigned m_zOrderListsDirty : 1;
160 unsigned m_normalFlowListDirty: 1;
161 unsigned m_isTreatedAsStackingContextForPainting : 1; 143 unsigned m_isTreatedAsStackingContextForPainting : 1;
162 144
163 #if ENABLE(ASSERT) 145 #if ENABLE(ASSERT)
164 unsigned m_layerListMutationAllowed : 1; 146 unsigned m_layerListMutationAllowed : 1;
165 DeprecatedPaintLayerStackingNode* m_stackingParent; 147 DeprecatedPaintLayerStackingNode* m_stackingParent;
166 #endif 148 #endif
167 }; 149 };
168 150
169 inline void DeprecatedPaintLayerStackingNode::clearZOrderLists() 151 inline void DeprecatedPaintLayerStackingNode::clearZOrderLists()
170 { 152 {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 191
210 private: 192 private:
211 DeprecatedPaintLayerStackingNode* m_stackingNode; 193 DeprecatedPaintLayerStackingNode* m_stackingNode;
212 bool m_previousMutationAllowedState; 194 bool m_previousMutationAllowedState;
213 }; 195 };
214 #endif 196 #endif
215 197
216 } // namespace blink 198 } // namespace blink
217 199
218 #endif // DeprecatedPaintLayerStackingNode_h 200 #endif // DeprecatedPaintLayerStackingNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698