OLD | NEW |
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 Loading... |
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 |
OLD | NEW |