| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 const TransformPaintPropertyNode* localTransformSpace() const { | 46 const TransformPaintPropertyNode* localTransformSpace() const { |
| 47 return m_localTransformSpace.get(); | 47 return m_localTransformSpace.get(); |
| 48 } | 48 } |
| 49 const FloatRoundedRect& clipRect() const { return m_clipRect; } | 49 const FloatRoundedRect& clipRect() const { return m_clipRect; } |
| 50 | 50 |
| 51 // Reference to inherited clips, or nullptr if this is the only clip. | 51 // Reference to inherited clips, or nullptr if this is the only clip. |
| 52 const ClipPaintPropertyNode* parent() const { return m_parent.get(); } | 52 const ClipPaintPropertyNode* parent() const { return m_parent.get(); } |
| 53 bool isRoot() const { return !m_parent; } | 53 bool isRoot() const { return !m_parent; } |
| 54 | 54 |
| 55 #if DCHECK_IS_ON() |
| 56 // The clone function is used by FindPropertiesNeedingUpdate.h for recording |
| 57 // a clip node before it has been updated, to later detect changes. |
| 58 PassRefPtr<ClipPaintPropertyNode> clone() const { |
| 59 return adoptRef( |
| 60 new ClipPaintPropertyNode(m_parent, m_localTransformSpace, m_clipRect)); |
| 61 } |
| 62 |
| 63 // The equality operator is used by FindPropertiesNeedingUpdate.h for checking |
| 64 // if a clip node has changed. |
| 65 bool operator==(const ClipPaintPropertyNode& o) const { |
| 66 return m_parent == o.m_parent && |
| 67 m_localTransformSpace == o.m_localTransformSpace && |
| 68 m_clipRect == o.m_clipRect; |
| 69 } |
| 70 #endif |
| 71 |
| 55 private: | 72 private: |
| 56 ClipPaintPropertyNode( | 73 ClipPaintPropertyNode( |
| 57 PassRefPtr<const ClipPaintPropertyNode> parent, | 74 PassRefPtr<const ClipPaintPropertyNode> parent, |
| 58 PassRefPtr<const TransformPaintPropertyNode> localTransformSpace, | 75 PassRefPtr<const TransformPaintPropertyNode> localTransformSpace, |
| 59 const FloatRoundedRect& clipRect) | 76 const FloatRoundedRect& clipRect) |
| 60 : m_parent(parent), | 77 : m_parent(parent), |
| 61 m_localTransformSpace(localTransformSpace), | 78 m_localTransformSpace(localTransformSpace), |
| 62 m_clipRect(clipRect) {} | 79 m_clipRect(clipRect) {} |
| 63 | 80 |
| 64 RefPtr<const ClipPaintPropertyNode> m_parent; | 81 RefPtr<const ClipPaintPropertyNode> m_parent; |
| 65 RefPtr<const TransformPaintPropertyNode> m_localTransformSpace; | 82 RefPtr<const TransformPaintPropertyNode> m_localTransformSpace; |
| 66 FloatRoundedRect m_clipRect; | 83 FloatRoundedRect m_clipRect; |
| 67 }; | 84 }; |
| 68 | 85 |
| 69 // Redeclared here to avoid ODR issues. | 86 // Redeclared here to avoid ODR issues. |
| 70 // See platform/testing/PaintPrinters.h. | 87 // See platform/testing/PaintPrinters.h. |
| 71 void PrintTo(const ClipPaintPropertyNode&, std::ostream*); | 88 void PrintTo(const ClipPaintPropertyNode&, std::ostream*); |
| 72 | 89 |
| 73 } // namespace blink | 90 } // namespace blink |
| 74 | 91 |
| 75 #endif // ClipPaintPropertyNode_h | 92 #endif // ClipPaintPropertyNode_h |
| OLD | NEW |