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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerStackingNode.h

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 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
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 30 matching lines...) Expand all
41 * If you do not delete the provisions above, a recipient may use your 41 * If you do not delete the provisions above, a recipient may use your
42 * version of this file under any of the LGPL, the MPL or the GPL. 42 * version of this file under any of the LGPL, the MPL or the GPL.
43 */ 43 */
44 44
45 #ifndef PaintLayerStackingNode_h 45 #ifndef PaintLayerStackingNode_h
46 #define PaintLayerStackingNode_h 46 #define PaintLayerStackingNode_h
47 47
48 #include "core/CoreExport.h" 48 #include "core/CoreExport.h"
49 #include "core/layout/LayoutBoxModelObject.h" 49 #include "core/layout/LayoutBoxModelObject.h"
50 #include "wtf/Noncopyable.h" 50 #include "wtf/Noncopyable.h"
51 #include "wtf/OwnPtr.h"
52 #include "wtf/Vector.h" 51 #include "wtf/Vector.h"
52 #include <memory>
53 53
54 namespace blink { 54 namespace blink {
55 55
56 class PaintLayer; 56 class PaintLayer;
57 class PaintLayerCompositor; 57 class PaintLayerCompositor;
58 class ComputedStyle; 58 class ComputedStyle;
59 class LayoutBoxModelObject; 59 class LayoutBoxModelObject;
60 60
61 // PaintLayerStackingNode represents a stacked element which is either a 61 // PaintLayerStackingNode represents a stacked element which is either a
62 // stacking context (i.e. an element with non-auto z-index) or a positioned 62 // stacking context (i.e. an element with non-auto z-index) or a positioned
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 142 }
143 143
144 Vector<PaintLayerStackingNode*>* negZOrderList() const 144 Vector<PaintLayerStackingNode*>* negZOrderList() const
145 { 145 {
146 ASSERT(!m_zOrderListsDirty); 146 ASSERT(!m_zOrderListsDirty);
147 ASSERT(isStackingContext() || !m_negZOrderList); 147 ASSERT(isStackingContext() || !m_negZOrderList);
148 return m_negZOrderList.get(); 148 return m_negZOrderList.get();
149 } 149 }
150 150
151 void rebuildZOrderLists(); 151 void rebuildZOrderLists();
152 void collectLayers(OwnPtr<Vector<PaintLayerStackingNode*>>& posZOrderList, O wnPtr<Vector<PaintLayerStackingNode*>>& negZOrderList); 152 void collectLayers(std::unique_ptr<Vector<PaintLayerStackingNode*>>& posZOrd erList, std::unique_ptr<Vector<PaintLayerStackingNode*>>& negZOrderList);
153 153
154 #if ENABLE(ASSERT) 154 #if ENABLE(ASSERT)
155 bool isInStackingParentZOrderLists() const; 155 bool isInStackingParentZOrderLists() const;
156 void updateStackingParentForZOrderLists(PaintLayerStackingNode* stackingPare nt); 156 void updateStackingParentForZOrderLists(PaintLayerStackingNode* stackingPare nt);
157 void setStackingParent(PaintLayerStackingNode* stackingParent) { m_stackingP arent = stackingParent; } 157 void setStackingParent(PaintLayerStackingNode* stackingParent) { m_stackingP arent = stackingParent; }
158 #endif 158 #endif
159 159
160 bool isDirtyStackingContext() const { return m_zOrderListsDirty && isStackin gContext(); } 160 bool isDirtyStackingContext() const { return m_zOrderListsDirty && isStackin gContext(); }
161 161
162 PaintLayerCompositor* compositor() const; 162 PaintLayerCompositor* compositor() const;
163 // We can't return a LayoutBox as LayoutInline can be a stacking context. 163 // We can't return a LayoutBox as LayoutInline can be a stacking context.
164 LayoutBoxModelObject* layoutObject() const; 164 LayoutBoxModelObject* layoutObject() const;
165 165
166 PaintLayer* m_layer; 166 PaintLayer* m_layer;
167 167
168 // m_posZOrderList holds a sorted list of all the descendant nodes within 168 // m_posZOrderList holds a sorted list of all the descendant nodes within
169 // that have z-indices of 0 (or is treated as 0 for positioned objects) or g reater. 169 // that have z-indices of 0 (or is treated as 0 for positioned objects) or g reater.
170 // m_negZOrderList holds descendants within our stacking context with 170 // m_negZOrderList holds descendants within our stacking context with
171 // negative z-indices. 171 // negative z-indices.
172 OwnPtr<Vector<PaintLayerStackingNode*>> m_posZOrderList; 172 std::unique_ptr<Vector<PaintLayerStackingNode*>> m_posZOrderList;
173 OwnPtr<Vector<PaintLayerStackingNode*>> m_negZOrderList; 173 std::unique_ptr<Vector<PaintLayerStackingNode*>> m_negZOrderList;
174 174
175 // This boolean caches whether the z-order lists above are dirty. 175 // This boolean caches whether the z-order lists above are dirty.
176 // It is only ever set for stacking contexts, as no other element can 176 // It is only ever set for stacking contexts, as no other element can
177 // have z-order lists. 177 // have z-order lists.
178 bool m_zOrderListsDirty : 1; 178 bool m_zOrderListsDirty : 1;
179 179
180 // This attribute caches whether the element was stacked. It's needed to che ck the 180 // This attribute caches whether the element was stacked. It's needed to che ck the
181 // current stacked status (instead of the new stacked status determined by t he new 181 // current stacked status (instead of the new stacked status determined by t he new
182 // style which has not been realized yet) when a layer is removed due to sty le change. 182 // style which has not been realized yet) when a layer is removed due to sty le change.
183 bool m_isStacked : 1; 183 bool m_isStacked : 1;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 private: 232 private:
233 PaintLayerStackingNode* m_stackingNode; 233 PaintLayerStackingNode* m_stackingNode;
234 bool m_previousMutationAllowedState; 234 bool m_previousMutationAllowedState;
235 }; 235 };
236 #endif 236 #endif
237 237
238 } // namespace blink 238 } // namespace blink
239 239
240 #endif // PaintLayerStackingNode_h 240 #endif // PaintLayerStackingNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698