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

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

Issue 2359063002: Add static root property tree nodes [spv2] (Closed)
Patch Set: Address reviewer comments and fix a test Created 4 years, 2 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 ClipPaintPropertyNode_h 5 #ifndef ClipPaintPropertyNode_h
6 #define ClipPaintPropertyNode_h 6 #define ClipPaintPropertyNode_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "platform/geometry/FloatRoundedRect.h" 9 #include "platform/geometry/FloatRoundedRect.h"
10 #include "platform/graphics/paint/TransformPaintPropertyNode.h" 10 #include "platform/graphics/paint/TransformPaintPropertyNode.h"
(...skipping 24 matching lines...) Expand all
35 m_parent = parent; 35 m_parent = parent;
36 m_localTransformSpace = localTransformSpace; 36 m_localTransformSpace = localTransformSpace;
37 m_clipRect = clipRect; 37 m_clipRect = clipRect;
38 } 38 }
39 39
40 const TransformPaintPropertyNode* localTransformSpace() const { return m_loc alTransformSpace.get(); } 40 const TransformPaintPropertyNode* localTransformSpace() const { return m_loc alTransformSpace.get(); }
41 const FloatRoundedRect& clipRect() const { return m_clipRect; } 41 const FloatRoundedRect& clipRect() const { return m_clipRect; }
42 42
43 // Reference to inherited clips, or nullptr if this is the only clip. 43 // Reference to inherited clips, or nullptr if this is the only clip.
44 const ClipPaintPropertyNode* parent() const { return m_parent.get(); } 44 const ClipPaintPropertyNode* parent() const { return m_parent.get(); }
45 bool isRoot() const { return !m_parent; }
45 46
46 private: 47 private:
47 ClipPaintPropertyNode(PassRefPtr<const ClipPaintPropertyNode> parent, PassRe fPtr<const TransformPaintPropertyNode> localTransformSpace, const FloatRoundedRe ct& clipRect) 48 ClipPaintPropertyNode(PassRefPtr<const ClipPaintPropertyNode> parent, PassRe fPtr<const TransformPaintPropertyNode> localTransformSpace, const FloatRoundedRe ct& clipRect)
48 : m_parent(parent), m_localTransformSpace(localTransformSpace), m_clipRe ct(clipRect) { } 49 : m_parent(parent), m_localTransformSpace(localTransformSpace), m_clipRe ct(clipRect) { }
49 50
50 RefPtr<const ClipPaintPropertyNode> m_parent; 51 RefPtr<const ClipPaintPropertyNode> m_parent;
51 RefPtr<const TransformPaintPropertyNode> m_localTransformSpace; 52 RefPtr<const TransformPaintPropertyNode> m_localTransformSpace;
52 FloatRoundedRect m_clipRect; 53 FloatRoundedRect m_clipRect;
53 }; 54 };
54 55
55 // Redeclared here to avoid ODR issues. 56 // Redeclared here to avoid ODR issues.
56 // See platform/testing/PaintPrinters.h. 57 // See platform/testing/PaintPrinters.h.
57 void PrintTo(const ClipPaintPropertyNode&, std::ostream*); 58 void PrintTo(const ClipPaintPropertyNode&, std::ostream*);
58 59
59 } // namespace blink 60 } // namespace blink
60 61
61 #endif // ClipPaintPropertyNode_h 62 #endif // ClipPaintPropertyNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698