| 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" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // |ancestorState|, if the transform is invertible. | 110 // |ancestorState|, if the transform is invertible. |
| 111 // | 111 // |
| 112 // If any of the paint property tree nodes in |localTransformState| are not | 112 // If any of the paint property tree nodes in |localTransformState| are not |
| 113 // equal to or a descendant of that in |ancestorState|, returns the passed-in | 113 // equal to or a descendant of that in |ancestorState|, returns the passed-in |
| 114 // rect and sets |success| to false. Otherwise, sets |success| to true. | 114 // rect and sets |success| to false. Otherwise, sets |success| to true. |
| 115 FloatRect ancestorToLocalRect(const FloatRect&, | 115 FloatRect ancestorToLocalRect(const FloatRect&, |
| 116 const PropertyTreeState& localTransformState, | 116 const PropertyTreeState& localTransformState, |
| 117 const PropertyTreeState& ancestorState, | 117 const PropertyTreeState& ancestorState, |
| 118 bool& success); | 118 bool& success); |
| 119 | 119 |
| 120 // Returns the matrix used in |LocalToAncestorRect|. Sets |success| to false |
| 121 // iff |localTransformNode| is not equal to or a descendant of |
| 122 // |ancestorState.transform|. |
| 123 const TransformationMatrix& localToAncestorMatrix( |
| 124 const TransformPaintPropertyNode* localTransformNode, |
| 125 const PropertyTreeState& ancestorState, |
| 126 bool& success); |
| 127 |
| 120 private: | 128 private: |
| 121 // Used by mapToVisualRectInDestinationSpace() after fast mapping (assuming | 129 // Used by mapToVisualRectInDestinationSpace() after fast mapping (assuming |
| 122 // destination is an ancestor of source) failed. | 130 // destination is an ancestor of source) failed. |
| 123 FloatRect slowMapToVisualRectInDestinationSpace( | 131 FloatRect slowMapToVisualRectInDestinationSpace( |
| 124 const FloatRect&, | 132 const FloatRect&, |
| 125 const PropertyTreeState& sourceState, | 133 const PropertyTreeState& sourceState, |
| 126 const PropertyTreeState& destinationState, | 134 const PropertyTreeState& destinationState, |
| 127 bool& success); | 135 bool& success); |
| 128 | 136 |
| 129 // Used by mapRectToDestinationSpace() after fast mapping (assuming | 137 // Used by mapRectToDestinationSpace() after fast mapping (assuming |
| 130 // destination is an ancestor of source) failed. | 138 // destination is an ancestor of source) failed. |
| 131 FloatRect slowMapRectToDestinationSpace( | 139 FloatRect slowMapRectToDestinationSpace( |
| 132 const FloatRect&, | 140 const FloatRect&, |
| 133 const PropertyTreeState& sourceState, | 141 const PropertyTreeState& sourceState, |
| 134 const PropertyTreeState& destinationState, | 142 const PropertyTreeState& destinationState, |
| 135 bool& success); | 143 bool& success); |
| 136 | 144 |
| 137 // Returns the matrix used in |LocalToAncestorRect|. Sets |success| to false | |
| 138 // iff |localTransformNode| is not equal to or a descendant of | |
| 139 // |ancestorState.transform|. | |
| 140 const TransformationMatrix& localToAncestorMatrix( | |
| 141 const TransformPaintPropertyNode* localTransformNode, | |
| 142 const PropertyTreeState& ancestorState, | |
| 143 bool& success); | |
| 144 | |
| 145 // Returns the "clip visual rect" between |localTransformState| and | 145 // Returns the "clip visual rect" between |localTransformState| and |
| 146 // |ancestorState|. See above for the definition of "clip visual rect". | 146 // |ancestorState|. See above for the definition of "clip visual rect". |
| 147 FloatRect localToAncestorClipRect( | 147 FloatRect localToAncestorClipRect( |
| 148 const PropertyTreeState& localTransformState, | 148 const PropertyTreeState& localTransformState, |
| 149 const PropertyTreeState& ancestorState, | 149 const PropertyTreeState& ancestorState, |
| 150 bool& success); | 150 bool& success); |
| 151 | 151 |
| 152 // Returns the precomputed data if already set, or adds and memoizes a new | 152 // Returns the precomputed data if already set, or adds and memoizes a new |
| 153 // PrecomputedDataForAncestor otherwise. | 153 // PrecomputedDataForAncestor otherwise. |
| 154 PrecomputedDataForAncestor& getPrecomputedDataForAncestor( | 154 PrecomputedDataForAncestor& getPrecomputedDataForAncestor( |
| (...skipping 11 matching lines...) Expand all 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 |