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 GeometryMapper_h | 5 #ifndef GeometryMapper_h |
6 #define GeometryMapper_h | 6 #define GeometryMapper_h |
7 | 7 |
8 #include "platform/geometry/FloatRect.h" | 8 #include "platform/geometry/FloatRect.h" |
9 #include "platform/graphics/paint/PropertyTreeState.h" | 9 #include "platform/graphics/paint/PropertyTreeState.h" |
10 #include "platform/transforms/TransformationMatrix.h" | 10 #include "platform/transforms/TransformationMatrix.h" |
11 #include "wtf/HashMap.h" | 11 #include "wtf/HashMap.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 struct PrecomputedDataForAncestor { | 15 struct PrecomputedDataForAncestor { |
16 // Maps from a transform node that is a descendant of the ancestor to the | 16 // Maps from a transform node that is a descendant of the ancestor to the |
17 // combined transform between the descendant's and the ancestor's coordinate | 17 // combined transform between the descendant's and the ancestor's coordinate |
18 // space. | 18 // space. |
19 HashMap<const TransformPaintPropertyNode*, TransformationMatrix> | 19 HashMap<const TransformPaintPropertyNode*, TransformationMatrix> |
20 toAncestorTransforms; | 20 toAncestorTransforms; |
21 | 21 |
22 // Maps from a descendant clip node to its equivalent "clip visual rect" in | 22 // Maps from a descendant clip node to its equivalent "clip visual rect" in |
23 // the space of the ancestor. The clip visual rect is defined as the | 23 // the space of the ancestor. The clip visual rect is defined as the |
24 // intersection of all clips between the descendant and the ancestor (*not* | 24 // intersection of all clips between the descendant and the ancestor (*not* |
25 // including the ancestor) in the clip tree, individually transformed from | 25 // including the ancestor) in the clip tree, individually transformed from |
26 // their localTransformSpace into the ancestor's localTransformSpace. | 26 // their localTransformSpace into the ancestor's localTransformSpace. |
27 HashMap<const ClipPaintPropertyNode*, FloatRect> toAncestorClipRects; | 27 HashMap<const ClipPaintPropertyNode*, FloatRect> toAncestorClipRects; |
28 | 28 |
29 static std::unique_ptr<PrecomputedDataForAncestor> create() { | 29 static std::unique_ptr<PrecomputedDataForAncestor> create() { |
30 return makeUnique<PrecomputedDataForAncestor>(); | 30 return WTF::makeUnique<PrecomputedDataForAncestor>(); |
31 } | 31 } |
32 }; | 32 }; |
33 | 33 |
34 // GeometryMapper is a helper class for fast computations of transformed and | 34 // GeometryMapper is a helper class for fast computations of transformed and |
35 // visual rects in different PropertyTreeStates. The design document has a | 35 // visual rects in different PropertyTreeStates. The design document has a |
36 // number of details on use cases, algorithmic definitions, and running times. | 36 // number of details on use cases, algorithmic definitions, and running times. |
37 // | 37 // |
38 // NOTE: A GeometryMapper object is only valid for property trees that do not | 38 // NOTE: A GeometryMapper object is only valid for property trees that do not |
39 // change. If any mutation occurs, a new GeometryMapper object must be allocated | 39 // change. If any mutation occurs, a new GeometryMapper object must be allocated |
40 // corresponding to the new state. | 40 // corresponding to the new state. |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 m_data; | 166 m_data; |
167 | 167 |
168 const TransformationMatrix m_identity; | 168 const TransformationMatrix m_identity; |
169 | 169 |
170 DISALLOW_COPY_AND_ASSIGN(GeometryMapper); | 170 DISALLOW_COPY_AND_ASSIGN(GeometryMapper); |
171 }; | 171 }; |
172 | 172 |
173 } // namespace blink | 173 } // namespace blink |
174 | 174 |
175 #endif // GeometryMapper_h | 175 #endif // GeometryMapper_h |
OLD | NEW |