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 TransformPaintPropertyNode_h | 5 #ifndef TransformPaintPropertyNode_h |
6 #define TransformPaintPropertyNode_h | 6 #define TransformPaintPropertyNode_h |
7 | 7 |
8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 #include "platform/geometry/FloatPoint3D.h" | 9 #include "platform/geometry/FloatPoint3D.h" |
10 #include "platform/graphics/CompositingReasons.h" | 10 #include "platform/graphics/CompositingReasons.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 const FloatPoint3D& origin, | 54 const FloatPoint3D& origin, |
55 bool flattensInheritedTransform, | 55 bool flattensInheritedTransform, |
56 unsigned renderingContextId, | 56 unsigned renderingContextId, |
57 CompositingReasons directCompositingReasons, | 57 CompositingReasons directCompositingReasons, |
58 const CompositorElementId& compositorElementId, | 58 const CompositorElementId& compositorElementId, |
59 PassRefPtr<const ScrollPaintPropertyNode> parentScroll, | 59 PassRefPtr<const ScrollPaintPropertyNode> parentScroll, |
60 const IntSize& clip, | 60 const IntSize& clip, |
61 const IntSize& bounds, | 61 const IntSize& bounds, |
62 bool userScrollableHorizontal, | 62 bool userScrollableHorizontal, |
63 bool userScrollableVertical, | 63 bool userScrollableVertical, |
64 MainThreadScrollingReasons mainThreadScrollingReasons) { | 64 MainThreadScrollingReasons mainThreadScrollingReasons, |
| 65 WebLayerScrollClient* scrollClient) { |
65 // If this transform is for scroll offset, it should be a 2d translation. | 66 // If this transform is for scroll offset, it should be a 2d translation. |
66 DCHECK(matrix.isIdentityOr2DTranslation()); | 67 DCHECK(matrix.isIdentityOr2DTranslation()); |
67 return adoptRef(new TransformPaintPropertyNode( | 68 return adoptRef(new TransformPaintPropertyNode( |
68 std::move(parent), matrix, origin, flattensInheritedTransform, | 69 std::move(parent), matrix, origin, flattensInheritedTransform, |
69 renderingContextId, directCompositingReasons, compositorElementId, | 70 renderingContextId, directCompositingReasons, compositorElementId, |
70 ScrollPaintPropertyNode::create( | 71 ScrollPaintPropertyNode::create( |
71 std::move(parentScroll), clip, bounds, userScrollableHorizontal, | 72 std::move(parentScroll), clip, bounds, userScrollableHorizontal, |
72 userScrollableVertical, mainThreadScrollingReasons))); | 73 userScrollableVertical, mainThreadScrollingReasons, scrollClient))); |
73 } | 74 } |
74 | 75 |
75 void update( | 76 void update( |
76 PassRefPtr<const TransformPaintPropertyNode> parent, | 77 PassRefPtr<const TransformPaintPropertyNode> parent, |
77 const TransformationMatrix& matrix, | 78 const TransformationMatrix& matrix, |
78 const FloatPoint3D& origin, | 79 const FloatPoint3D& origin, |
79 bool flattensInheritedTransform = false, | 80 bool flattensInheritedTransform = false, |
80 unsigned renderingContextId = 0, | 81 unsigned renderingContextId = 0, |
81 CompositingReasons directCompositingReasons = CompositingReasonNone, | 82 CompositingReasons directCompositingReasons = CompositingReasonNone, |
82 CompositorElementId compositorElementId = CompositorElementId()) { | 83 CompositorElementId compositorElementId = CompositorElementId()) { |
(...skipping 14 matching lines...) Expand all Loading... |
97 const FloatPoint3D& origin, | 98 const FloatPoint3D& origin, |
98 bool flattensInheritedTransform, | 99 bool flattensInheritedTransform, |
99 unsigned renderingContextId, | 100 unsigned renderingContextId, |
100 CompositingReasons directCompositingReasons, | 101 CompositingReasons directCompositingReasons, |
101 CompositorElementId compositorElementId, | 102 CompositorElementId compositorElementId, |
102 PassRefPtr<const ScrollPaintPropertyNode> parentScroll, | 103 PassRefPtr<const ScrollPaintPropertyNode> parentScroll, |
103 const IntSize& clip, | 104 const IntSize& clip, |
104 const IntSize& bounds, | 105 const IntSize& bounds, |
105 bool userScrollableHorizontal, | 106 bool userScrollableHorizontal, |
106 bool userScrollableVertical, | 107 bool userScrollableVertical, |
107 MainThreadScrollingReasons mainThreadScrollingReasons) { | 108 MainThreadScrollingReasons mainThreadScrollingReasons, |
| 109 WebLayerScrollClient* scrollClient) { |
108 update(std::move(parent), matrix, origin, flattensInheritedTransform, | 110 update(std::move(parent), matrix, origin, flattensInheritedTransform, |
109 renderingContextId, directCompositingReasons, compositorElementId); | 111 renderingContextId, directCompositingReasons, compositorElementId); |
110 DCHECK(m_scroll); | 112 DCHECK(m_scroll); |
111 DCHECK(matrix.isIdentityOr2DTranslation()); | 113 DCHECK(matrix.isIdentityOr2DTranslation()); |
112 m_scroll->update(std::move(parentScroll), clip, bounds, | 114 m_scroll->update(std::move(parentScroll), clip, bounds, |
113 userScrollableHorizontal, userScrollableVertical, | 115 userScrollableHorizontal, userScrollableVertical, |
114 mainThreadScrollingReasons); | 116 mainThreadScrollingReasons, scrollClient); |
115 } | 117 } |
116 | 118 |
117 const TransformationMatrix& matrix() const { return m_matrix; } | 119 const TransformationMatrix& matrix() const { return m_matrix; } |
118 const FloatPoint3D& origin() const { return m_origin; } | 120 const FloatPoint3D& origin() const { return m_origin; } |
119 | 121 |
120 // Parent transform that this transform is relative to, or nullptr if this | 122 // Parent transform that this transform is relative to, or nullptr if this |
121 // is the root transform. | 123 // is the root transform. |
122 const TransformPaintPropertyNode* parent() const { return m_parent.get(); } | 124 const TransformPaintPropertyNode* parent() const { return m_parent.get(); } |
123 bool isRoot() const { return !m_parent; } | 125 bool isRoot() const { return !m_parent; } |
124 | 126 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 RefPtr<ScrollPaintPropertyNode> m_scroll; | 217 RefPtr<ScrollPaintPropertyNode> m_scroll; |
216 }; | 218 }; |
217 | 219 |
218 // Redeclared here to avoid ODR issues. | 220 // Redeclared here to avoid ODR issues. |
219 // See platform/testing/PaintPrinters.h. | 221 // See platform/testing/PaintPrinters.h. |
220 void PrintTo(const TransformPaintPropertyNode&, std::ostream*); | 222 void PrintTo(const TransformPaintPropertyNode&, std::ostream*); |
221 | 223 |
222 } // namespace blink | 224 } // namespace blink |
223 | 225 |
224 #endif // TransformPaintPropertyNode_h | 226 #endif // TransformPaintPropertyNode_h |
OLD | NEW |