| 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" |
| 11 #include "wtf/PassRefPtr.h" | 11 #include "wtf/PassRefPtr.h" |
| 12 #include "wtf/RefCounted.h" | 12 #include "wtf/RefCounted.h" |
| 13 #include "wtf/RefPtr.h" | 13 #include "wtf/RefPtr.h" |
| 14 | 14 |
| 15 #include <iosfwd> | 15 #include <iosfwd> |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 // A clip rect created by a css property such as "overflow" or "clip". | 19 // A clip rect created by a css property such as "overflow" or "clip". |
| 20 // Along with a reference to the transform space the clip rect is based on, | 20 // Along with a reference to the transform space the clip rect is based on, |
| 21 // and an (optional) parent ClipPaintPropertyNode for inherited clips. | 21 // and an (optional) parent ClipPaintPropertyNode for inherited clips. |
| 22 class PLATFORM_EXPORT ClipPaintPropertyNode : public RefCounted<ClipPaintPropert
yNode> { | 22 class PLATFORM_EXPORT ClipPaintPropertyNode : public RefCounted<ClipPaintPropert
yNode> { |
| 23 public: | 23 public: |
| 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(parent, localTransformSpace, c
lipRect)); | 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 m_parent = parent; | 34 m_parent = parent; |
| 35 m_localTransformSpace = localTransformSpace; | 35 m_localTransformSpace = localTransformSpace; |
| 36 m_clipRect = clipRect; | 36 m_clipRect = clipRect; |
| 37 } | 37 } |
| 38 | 38 |
| 39 const TransformPaintPropertyNode* localTransformSpace() const { return m_loc
alTransformSpace.get(); } | 39 const TransformPaintPropertyNode* localTransformSpace() const { return m_loc
alTransformSpace.get(); } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 51 FloatRoundedRect m_clipRect; | 51 FloatRoundedRect m_clipRect; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 // Redeclared here to avoid ODR issues. | 54 // Redeclared here to avoid ODR issues. |
| 55 // See platform/testing/PaintPrinters.h. | 55 // See platform/testing/PaintPrinters.h. |
| 56 void PrintTo(const ClipPaintPropertyNode&, std::ostream*); | 56 void PrintTo(const ClipPaintPropertyNode&, std::ostream*); |
| 57 | 57 |
| 58 } // namespace blink | 58 } // namespace blink |
| 59 | 59 |
| 60 #endif // ClipPaintPropertyNode_h | 60 #endif // ClipPaintPropertyNode_h |
| OLD | NEW |