| 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 13 matching lines...) Expand all Loading... |
| 24 static PassRefPtr<ClipPaintPropertyNode> create( | 24 static PassRefPtr<ClipPaintPropertyNode> create( |
| 25 PassRefPtr<const ClipPaintPropertyNode> parent, | 25 PassRefPtr<const ClipPaintPropertyNode> parent, |
| 26 PassRefPtr<const TransformPaintPropertyNode> localTransformSpace, | 26 PassRefPtr<const TransformPaintPropertyNode> localTransformSpace, |
| 27 const FloatRoundedRect& clipRect) | 27 const FloatRoundedRect& clipRect) |
| 28 { | 28 { |
| 29 return adoptRef(new ClipPaintPropertyNode(std::move(parent), std::move(l
ocalTransformSpace), clipRect)); | 29 return adoptRef(new ClipPaintPropertyNode(std::move(parent), std::move(l
ocalTransformSpace), clipRect)); |
| 30 } | 30 } |
| 31 | 31 |
| 32 void update(PassRefPtr<const ClipPaintPropertyNode> parent, PassRefPtr<const
TransformPaintPropertyNode> localTransformSpace, const FloatRoundedRect& clipRe
ct) | 32 void update(PassRefPtr<const ClipPaintPropertyNode> parent, PassRefPtr<const
TransformPaintPropertyNode> localTransformSpace, const FloatRoundedRect& clipRe
ct) |
| 33 { | 33 { |
| 34 DCHECK(parent != this); |
| 34 m_parent = parent; | 35 m_parent = parent; |
| 35 m_localTransformSpace = localTransformSpace; | 36 m_localTransformSpace = localTransformSpace; |
| 36 m_clipRect = clipRect; | 37 m_clipRect = clipRect; |
| 37 } | 38 } |
| 38 | 39 |
| 39 const TransformPaintPropertyNode* localTransformSpace() const { return m_loc
alTransformSpace.get(); } | 40 const TransformPaintPropertyNode* localTransformSpace() const { return m_loc
alTransformSpace.get(); } |
| 40 const FloatRoundedRect& clipRect() const { return m_clipRect; } | 41 const FloatRoundedRect& clipRect() const { return m_clipRect; } |
| 41 | 42 |
| 42 // 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. |
| 43 const ClipPaintPropertyNode* parent() const { return m_parent.get(); } | 44 const ClipPaintPropertyNode* parent() const { return m_parent.get(); } |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 ClipPaintPropertyNode(PassRefPtr<const ClipPaintPropertyNode> parent, PassRe
fPtr<const TransformPaintPropertyNode> localTransformSpace, const FloatRoundedRe
ct& clipRect) | 47 ClipPaintPropertyNode(PassRefPtr<const ClipPaintPropertyNode> parent, PassRe
fPtr<const TransformPaintPropertyNode> localTransformSpace, const FloatRoundedRe
ct& clipRect) |
| 47 : m_parent(parent), m_localTransformSpace(localTransformSpace), m_clipRe
ct(clipRect) { } | 48 : m_parent(parent), m_localTransformSpace(localTransformSpace), m_clipRe
ct(clipRect) { } |
| 48 | 49 |
| 49 RefPtr<const ClipPaintPropertyNode> m_parent; | 50 RefPtr<const ClipPaintPropertyNode> m_parent; |
| 50 RefPtr<const TransformPaintPropertyNode> m_localTransformSpace; | 51 RefPtr<const TransformPaintPropertyNode> m_localTransformSpace; |
| 51 FloatRoundedRect m_clipRect; | 52 FloatRoundedRect m_clipRect; |
| 52 }; | 53 }; |
| 53 | 54 |
| 54 // Redeclared here to avoid ODR issues. | 55 // Redeclared here to avoid ODR issues. |
| 55 // See platform/testing/PaintPrinters.h. | 56 // See platform/testing/PaintPrinters.h. |
| 56 void PrintTo(const ClipPaintPropertyNode&, std::ostream*); | 57 void PrintTo(const ClipPaintPropertyNode&, std::ostream*); |
| 57 | 58 |
| 58 } // namespace blink | 59 } // namespace blink |
| 59 | 60 |
| 60 #endif // ClipPaintPropertyNode_h | 61 #endif // ClipPaintPropertyNode_h |
| OLD | NEW |