| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 ScrollPaintPropertyNode_h | 5 #ifndef ScrollPaintPropertyNode_h |
| 6 #define ScrollPaintPropertyNode_h | 6 #define ScrollPaintPropertyNode_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/geometry/FloatSize.h" | 9 #include "platform/geometry/FloatSize.h" |
| 10 #include "platform/graphics/paint/TransformPaintPropertyNode.h" | 10 #include "platform/graphics/paint/TransformPaintPropertyNode.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 m_parent = parent; | 53 m_parent = parent; |
| 54 DCHECK(scrollOffsetTranslation->matrix().isIdentityOr2DTranslation()); | 54 DCHECK(scrollOffsetTranslation->matrix().isIdentityOr2DTranslation()); |
| 55 m_scrollOffsetTranslation = scrollOffsetTranslation; | 55 m_scrollOffsetTranslation = scrollOffsetTranslation; |
| 56 m_clip = clip; | 56 m_clip = clip; |
| 57 m_bounds = bounds; | 57 m_bounds = bounds; |
| 58 m_userScrollableHorizontal = userScrollableHorizontal; | 58 m_userScrollableHorizontal = userScrollableHorizontal; |
| 59 m_userScrollableVertical = userScrollableVertical; | 59 m_userScrollableVertical = userScrollableVertical; |
| 60 m_mainThreadScrollingReasons = 0; | 60 m_mainThreadScrollingReasons = 0; |
| 61 } | 61 } |
| 62 | 62 |
| 63 // TODO(pdr): Correctly clone main thread scrolling reasons. |
| 64 PassRefPtr<ScrollPaintPropertyNode> clone() const { |
| 65 return adoptRef(new ScrollPaintPropertyNode( |
| 66 m_parent, m_scrollOffsetTranslation, m_clip, m_bounds, |
| 67 m_userScrollableHorizontal, m_userScrollableVertical)); |
| 68 } |
| 69 |
| 70 bool operator==(const ScrollPaintPropertyNode& o) const { |
| 71 return m_parent == o.m_parent && |
| 72 m_scrollOffsetTranslation == o.m_scrollOffsetTranslation && |
| 73 m_clip == o.m_clip && m_bounds == o.m_bounds && |
| 74 m_userScrollableHorizontal == o.m_userScrollableHorizontal && |
| 75 m_userScrollableVertical == o.m_userScrollableVertical && |
| 76 m_mainThreadScrollingReasons == o.m_mainThreadScrollingReasons; |
| 77 } |
| 78 |
| 63 ScrollPaintPropertyNode* parent() const { return m_parent.get(); } | 79 ScrollPaintPropertyNode* parent() const { return m_parent.get(); } |
| 64 bool isRoot() const { return !m_parent; } | 80 bool isRoot() const { return !m_parent; } |
| 65 | 81 |
| 66 // Transform that the scroll is relative to. | 82 // Transform that the scroll is relative to. |
| 67 const TransformPaintPropertyNode* scrollOffsetTranslation() const { | 83 const TransformPaintPropertyNode* scrollOffsetTranslation() const { |
| 68 return m_scrollOffsetTranslation.get(); | 84 return m_scrollOffsetTranslation.get(); |
| 69 } | 85 } |
| 70 | 86 |
| 71 // The clipped area that contains the scrolled content. | 87 // The clipped area that contains the scrolled content. |
| 72 const IntSize& clip() const { return m_clip; } | 88 const IntSize& clip() const { return m_clip; } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // TODO(pdr): Add a bit for whether this is affected by page scale. | 135 // TODO(pdr): Add a bit for whether this is affected by page scale. |
| 120 }; | 136 }; |
| 121 | 137 |
| 122 // Redeclared here to avoid ODR issues. | 138 // Redeclared here to avoid ODR issues. |
| 123 // See platform/testing/PaintPrinters.h. | 139 // See platform/testing/PaintPrinters.h. |
| 124 void PrintTo(const ScrollPaintPropertyNode&, std::ostream*); | 140 void PrintTo(const ScrollPaintPropertyNode&, std::ostream*); |
| 125 | 141 |
| 126 } // namespace blink | 142 } // namespace blink |
| 127 | 143 |
| 128 #endif // ScrollPaintPropertyNode_h | 144 #endif // ScrollPaintPropertyNode_h |
| OLD | NEW |