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

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

Issue 2359063002: Add static root property tree nodes [spv2] (Closed)
Patch Set: Address reviewer comments and fix a test Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 EffectPaintPropertyNode_h 5 #ifndef EffectPaintPropertyNode_h
6 #define EffectPaintPropertyNode_h 6 #define EffectPaintPropertyNode_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "wtf/PassRefPtr.h" 9 #include "wtf/PassRefPtr.h"
10 #include "wtf/RefCounted.h" 10 #include "wtf/RefCounted.h"
(...skipping 17 matching lines...) Expand all
28 { 28 {
29 DCHECK(parent != this); 29 DCHECK(parent != this);
30 m_parent = parent; 30 m_parent = parent;
31 m_opacity = opacity; 31 m_opacity = opacity;
32 } 32 }
33 33
34 float opacity() const { return m_opacity; } 34 float opacity() const { return m_opacity; }
35 35
36 // Parent effect or nullptr if this is the root effect. 36 // Parent effect or nullptr if this is the root effect.
37 const EffectPaintPropertyNode* parent() const { return m_parent.get(); } 37 const EffectPaintPropertyNode* parent() const { return m_parent.get(); }
38 bool isRoot() const { return !m_parent; }
38 39
39 private: 40 private:
40 EffectPaintPropertyNode(PassRefPtr<const EffectPaintPropertyNode> parent, fl oat opacity) 41 EffectPaintPropertyNode(PassRefPtr<const EffectPaintPropertyNode> parent, fl oat opacity)
41 : m_parent(parent), m_opacity(opacity) { } 42 : m_parent(parent), m_opacity(opacity) { }
42 43
43 RefPtr<const EffectPaintPropertyNode> m_parent; 44 RefPtr<const EffectPaintPropertyNode> m_parent;
44 float m_opacity; 45 float m_opacity;
45 }; 46 };
46 47
47 // Redeclared here to avoid ODR issues. 48 // Redeclared here to avoid ODR issues.
48 // See platform/testing/PaintPrinters.h. 49 // See platform/testing/PaintPrinters.h.
49 void PrintTo(const EffectPaintPropertyNode&, std::ostream*); 50 void PrintTo(const EffectPaintPropertyNode&, std::ostream*);
50 51
51 } // namespace blink 52 } // namespace blink
52 53
53 #endif // EffectPaintPropertyNode_h 54 #endif // EffectPaintPropertyNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698