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