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 18 matching lines...) Expand all Loading... |
29 static TransformPaintPropertyNode* root(); | 29 static TransformPaintPropertyNode* root(); |
30 | 30 |
31 static PassRefPtr<TransformPaintPropertyNode> create( | 31 static PassRefPtr<TransformPaintPropertyNode> create( |
32 PassRefPtr<const TransformPaintPropertyNode> parent, | 32 PassRefPtr<const TransformPaintPropertyNode> parent, |
33 const TransformationMatrix& matrix, | 33 const TransformationMatrix& matrix, |
34 const FloatPoint3D& origin, | 34 const FloatPoint3D& origin, |
35 bool flattensInheritedTransform = false, | 35 bool flattensInheritedTransform = false, |
36 unsigned renderingContextID = 0, | 36 unsigned renderingContextID = 0, |
37 CompositingReasons directCompositingReasons = CompositingReasonNone) { | 37 CompositingReasons directCompositingReasons = CompositingReasonNone) { |
38 return adoptRef(new TransformPaintPropertyNode( | 38 return adoptRef(new TransformPaintPropertyNode( |
39 matrix, origin, std::move(parent), flattensInheritedTransform, | 39 std::move(parent), matrix, origin, flattensInheritedTransform, |
40 renderingContextID, directCompositingReasons)); | 40 renderingContextID, directCompositingReasons)); |
41 } | 41 } |
42 | 42 |
43 void update( | 43 void update( |
44 PassRefPtr<const TransformPaintPropertyNode> parent, | 44 PassRefPtr<const TransformPaintPropertyNode> parent, |
45 const TransformationMatrix& matrix, | 45 const TransformationMatrix& matrix, |
46 const FloatPoint3D& origin, | 46 const FloatPoint3D& origin, |
47 bool flattensInheritedTransform = false, | 47 bool flattensInheritedTransform = false, |
48 unsigned renderingContextID = 0, | 48 unsigned renderingContextID = 0, |
49 CompositingReasons directCompositingReasons = CompositingReasonNone) { | 49 CompositingReasons directCompositingReasons = CompositingReasonNone) { |
(...skipping 29 matching lines...) Expand all Loading... |
79 // Content whose transform nodes have a common rendering context ID are 3D | 79 // Content whose transform nodes have a common rendering context ID are 3D |
80 // sorted. If this is 0, content will not be 3D sorted. | 80 // sorted. If this is 0, content will not be 3D sorted. |
81 unsigned renderingContextID() const { return m_renderingContextID; } | 81 unsigned renderingContextID() const { return m_renderingContextID; } |
82 bool hasRenderingContext() const { return m_renderingContextID; } | 82 bool hasRenderingContext() const { return m_renderingContextID; } |
83 | 83 |
84 #if DCHECK_IS_ON() | 84 #if DCHECK_IS_ON() |
85 // The clone function is used by FindPropertiesNeedingUpdate.h for recording | 85 // The clone function is used by FindPropertiesNeedingUpdate.h for recording |
86 // a transform node before it has been updated, to later detect changes. | 86 // a transform node before it has been updated, to later detect changes. |
87 PassRefPtr<TransformPaintPropertyNode> clone() const { | 87 PassRefPtr<TransformPaintPropertyNode> clone() const { |
88 return adoptRef(new TransformPaintPropertyNode( | 88 return adoptRef(new TransformPaintPropertyNode( |
89 m_matrix, m_origin, m_parent, m_flattensInheritedTransform, | 89 m_parent, m_matrix, m_origin, m_flattensInheritedTransform, |
90 m_renderingContextID, m_directCompositingReasons)); | 90 m_renderingContextID, m_directCompositingReasons)); |
91 } | 91 } |
92 | 92 |
93 // The equality operator is used by FindPropertiesNeedingUpdate.h for checking | 93 // The equality operator is used by FindPropertiesNeedingUpdate.h for checking |
94 // if a transform node has changed. | 94 // if a transform node has changed. |
95 bool operator==(const TransformPaintPropertyNode& o) const { | 95 bool operator==(const TransformPaintPropertyNode& o) const { |
96 return m_matrix == o.m_matrix && m_origin == o.m_origin && | 96 return m_parent == o.m_parent && m_matrix == o.m_matrix && |
97 m_parent == o.m_parent && | 97 m_origin == o.m_origin && |
98 m_flattensInheritedTransform == o.m_flattensInheritedTransform && | 98 m_flattensInheritedTransform == o.m_flattensInheritedTransform && |
99 m_renderingContextID == o.m_renderingContextID; | 99 m_renderingContextID == o.m_renderingContextID && |
| 100 m_directCompositingReasons == o.m_directCompositingReasons; |
100 } | 101 } |
101 #endif | 102 #endif |
102 | 103 |
103 String toString() const; | 104 String toString() const; |
104 | 105 |
105 private: | 106 private: |
106 TransformPaintPropertyNode( | 107 TransformPaintPropertyNode( |
| 108 PassRefPtr<const TransformPaintPropertyNode> parent, |
107 const TransformationMatrix& matrix, | 109 const TransformationMatrix& matrix, |
108 const FloatPoint3D& origin, | 110 const FloatPoint3D& origin, |
109 PassRefPtr<const TransformPaintPropertyNode> parent, | |
110 bool flattensInheritedTransform, | 111 bool flattensInheritedTransform, |
111 unsigned renderingContextID, | 112 unsigned renderingContextID, |
112 CompositingReasons directCompositingReasons) | 113 CompositingReasons directCompositingReasons) |
113 : m_matrix(matrix), | 114 : m_parent(parent), |
| 115 m_matrix(matrix), |
114 m_origin(origin), | 116 m_origin(origin), |
115 m_parent(parent), | |
116 m_flattensInheritedTransform(flattensInheritedTransform), | 117 m_flattensInheritedTransform(flattensInheritedTransform), |
117 m_renderingContextID(renderingContextID), | 118 m_renderingContextID(renderingContextID), |
118 m_directCompositingReasons(directCompositingReasons) {} | 119 m_directCompositingReasons(directCompositingReasons) {} |
119 | 120 |
| 121 RefPtr<const TransformPaintPropertyNode> m_parent; |
120 TransformationMatrix m_matrix; | 122 TransformationMatrix m_matrix; |
121 FloatPoint3D m_origin; | 123 FloatPoint3D m_origin; |
122 RefPtr<const TransformPaintPropertyNode> m_parent; | |
123 bool m_flattensInheritedTransform; | 124 bool m_flattensInheritedTransform; |
124 unsigned m_renderingContextID; | 125 unsigned m_renderingContextID; |
125 CompositingReasons m_directCompositingReasons; | 126 CompositingReasons m_directCompositingReasons; |
126 }; | 127 }; |
127 | 128 |
128 // Redeclared here to avoid ODR issues. | 129 // Redeclared here to avoid ODR issues. |
129 // See platform/testing/PaintPrinters.h. | 130 // See platform/testing/PaintPrinters.h. |
130 void PrintTo(const TransformPaintPropertyNode&, std::ostream*); | 131 void PrintTo(const TransformPaintPropertyNode&, std::ostream*); |
131 | 132 |
132 } // namespace blink | 133 } // namespace blink |
133 | 134 |
134 #endif // TransformPaintPropertyNode_h | 135 #endif // TransformPaintPropertyNode_h |
OLD | NEW |