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" |
11 #include "platform/graphics/CompositorElementId.h" | 11 #include "platform/graphics/CompositorElementId.h" |
12 #include "platform/graphics/paint/GeometryMapperTransformCache.h" | |
13 #include "platform/graphics/paint/ScrollPaintPropertyNode.h" | 12 #include "platform/graphics/paint/ScrollPaintPropertyNode.h" |
14 #include "platform/transforms/TransformationMatrix.h" | 13 #include "platform/transforms/TransformationMatrix.h" |
15 #include "wtf/PassRefPtr.h" | 14 #include "wtf/PassRefPtr.h" |
16 #include "wtf/RefCounted.h" | 15 #include "wtf/RefCounted.h" |
17 #include "wtf/RefPtr.h" | 16 #include "wtf/RefPtr.h" |
18 #include "wtf/text/WTFString.h" | 17 #include "wtf/text/WTFString.h" |
19 | 18 |
20 #include <iosfwd> | 19 #include <iosfwd> |
21 | 20 |
22 namespace blink { | 21 namespace blink { |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 PassRefPtr<ScrollPaintPropertyNode> scroll = nullptr) | 200 PassRefPtr<ScrollPaintPropertyNode> scroll = nullptr) |
202 : m_parent(parent), | 201 : m_parent(parent), |
203 m_matrix(matrix), | 202 m_matrix(matrix), |
204 m_origin(origin), | 203 m_origin(origin), |
205 m_flattensInheritedTransform(flattensInheritedTransform), | 204 m_flattensInheritedTransform(flattensInheritedTransform), |
206 m_renderingContextId(renderingContextId), | 205 m_renderingContextId(renderingContextId), |
207 m_directCompositingReasons(directCompositingReasons), | 206 m_directCompositingReasons(directCompositingReasons), |
208 m_compositorElementId(compositorElementId), | 207 m_compositorElementId(compositorElementId), |
209 m_scroll(scroll) {} | 208 m_scroll(scroll) {} |
210 | 209 |
211 // For access to getTransformCache() and setCachedTransform. | |
212 friend class GeometryMapper; | |
213 friend class GeometryMapperTest; | |
214 | |
215 GeometryMapperTransformCache& getTransformCache() const { | |
216 return const_cast<TransformPaintPropertyNode*>(this)->getTransformCache(); | |
217 } | |
218 | |
219 GeometryMapperTransformCache& getTransformCache() { | |
220 if (!m_geometryMapperTransformCache) | |
221 m_geometryMapperTransformCache.reset(new GeometryMapperTransformCache()); | |
222 return *m_geometryMapperTransformCache.get(); | |
223 } | |
224 | |
225 RefPtr<const TransformPaintPropertyNode> m_parent; | 210 RefPtr<const TransformPaintPropertyNode> m_parent; |
226 TransformationMatrix m_matrix; | 211 TransformationMatrix m_matrix; |
227 FloatPoint3D m_origin; | 212 FloatPoint3D m_origin; |
228 bool m_flattensInheritedTransform; | 213 bool m_flattensInheritedTransform; |
229 unsigned m_renderingContextId; | 214 unsigned m_renderingContextId; |
230 CompositingReasons m_directCompositingReasons; | 215 CompositingReasons m_directCompositingReasons; |
231 CompositorElementId m_compositorElementId; | 216 CompositorElementId m_compositorElementId; |
232 RefPtr<ScrollPaintPropertyNode> m_scroll; | 217 RefPtr<ScrollPaintPropertyNode> m_scroll; |
233 | |
234 std::unique_ptr<GeometryMapperTransformCache> m_geometryMapperTransformCache; | |
235 }; | 218 }; |
236 | 219 |
237 // Redeclared here to avoid ODR issues. | 220 // Redeclared here to avoid ODR issues. |
238 // See platform/testing/PaintPrinters.h. | 221 // See platform/testing/PaintPrinters.h. |
239 void PrintTo(const TransformPaintPropertyNode&, std::ostream*); | 222 void PrintTo(const TransformPaintPropertyNode&, std::ostream*); |
240 | 223 |
241 } // namespace blink | 224 } // namespace blink |
242 | 225 |
243 #endif // TransformPaintPropertyNode_h | 226 #endif // TransformPaintPropertyNode_h |
OLD | NEW |