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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.h

Issue 2751433002: [SPv2] Flatten property trees in PaintRecordBuilder into a single display list. (Closed)
Patch Set: none Created 3 years, 8 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PropertyTreeState_h 5 #ifndef PropertyTreeState_h
6 #define PropertyTreeState_h 6 #define PropertyTreeState_h
7 7
8 #include "platform/graphics/paint/ClipPaintPropertyNode.h" 8 #include "platform/graphics/paint/ClipPaintPropertyNode.h"
9 #include "platform/graphics/paint/EffectPaintPropertyNode.h" 9 #include "platform/graphics/paint/EffectPaintPropertyNode.h"
10 #include "platform/graphics/paint/TransformPaintPropertyNode.h" 10 #include "platform/graphics/paint/TransformPaintPropertyNode.h"
(...skipping 11 matching lines...) Expand all
22 public: 22 public:
23 PropertyTreeState(const TransformPaintPropertyNode* transform, 23 PropertyTreeState(const TransformPaintPropertyNode* transform,
24 const ClipPaintPropertyNode* clip, 24 const ClipPaintPropertyNode* clip,
25 const EffectPaintPropertyNode* effect) 25 const EffectPaintPropertyNode* effect)
26 : m_transform(transform), m_clip(clip), m_effect(effect) { 26 : m_transform(transform), m_clip(clip), m_effect(effect) {
27 DCHECK(!m_transform || !m_transform->hasOneRef()); 27 DCHECK(!m_transform || !m_transform->hasOneRef());
28 DCHECK(!m_clip || !m_clip->hasOneRef()); 28 DCHECK(!m_clip || !m_clip->hasOneRef());
29 DCHECK(!m_effect || !m_effect->hasOneRef()); 29 DCHECK(!m_effect || !m_effect->hasOneRef());
30 } 30 }
31 31
32 PropertyTreeState(const PropertyTreeState& other) = default;
pdr. 2017/03/28 21:01:30 I haven't seen this before but just read about it
chrishtr 2017/03/28 21:43:23 Removed, not needed in this version of the CL.
33
32 bool hasDirectCompositingReasons() const; 34 bool hasDirectCompositingReasons() const;
33 35
34 const TransformPaintPropertyNode* transform() const { 36 const TransformPaintPropertyNode* transform() const {
35 DCHECK(!m_transform || !m_transform->hasOneRef()); 37 DCHECK(!m_transform || !m_transform->hasOneRef());
36 return m_transform.get(); 38 return m_transform.get();
37 } 39 }
38 void setTransform(RefPtr<const TransformPaintPropertyNode> node) { 40 void setTransform(RefPtr<const TransformPaintPropertyNode> node) {
39 m_transform = std::move(node); 41 m_transform = std::move(node);
40 } 42 }
41 43
42 const ClipPaintPropertyNode* clip() const { 44 const ClipPaintPropertyNode* clip() const {
43 DCHECK(!m_clip || !m_clip->hasOneRef()); 45 DCHECK(!m_clip || !m_clip->hasOneRef());
44 return m_clip.get(); 46 return m_clip.get();
45 } 47 }
46 void setClip(RefPtr<const ClipPaintPropertyNode> node) { 48 void setClip(RefPtr<const ClipPaintPropertyNode> node) {
47 m_clip = std::move(node); 49 m_clip = std::move(node);
48 } 50 }
49 51
50 const EffectPaintPropertyNode* effect() const { 52 const EffectPaintPropertyNode* effect() const {
51 DCHECK(!m_effect || !m_effect->hasOneRef()); 53 DCHECK(!m_effect || !m_effect->hasOneRef());
52 return m_effect.get(); 54 return m_effect.get();
53 } 55 }
54 void setEffect(RefPtr<const EffectPaintPropertyNode> node) { 56 void setEffect(RefPtr<const EffectPaintPropertyNode> node) {
55 m_effect = std::move(node); 57 m_effect = std::move(node);
56 } 58 }
57 59
60 static const PropertyTreeState& root();
61
58 // Returns the compositor element id, if any, for this property state. If 62 // Returns the compositor element id, if any, for this property state. If
59 // neither the effect nor transform nodes have a compositor element id then a 63 // neither the effect nor transform nodes have a compositor element id then a
60 // default instance is returned. 64 // default instance is returned.
61 const CompositorElementId compositorElementId() const; 65 const CompositorElementId compositorElementId() const;
62 66
63 enum InnermostNode { 67 enum InnermostNode {
64 None, // None means that all nodes are their root values 68 None, // None means that all nodes are their root values
65 Transform, 69 Transform,
66 Clip, 70 Clip,
67 Effect, 71 Effect,
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 } 180 }
177 181
178 HashMap<const PropertyTreeNode*, String> m_nodeToDebugString; 182 HashMap<const PropertyTreeNode*, String> m_nodeToDebugString;
179 }; 183 };
180 184
181 #endif 185 #endif
182 186
183 } // namespace blink 187 } // namespace blink
184 188
185 #endif // PropertyTreeState_h 189 #endif // PropertyTreeState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698