| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_GFX_TRANSFORM_H_ | 5 #ifndef UI_GFX_TRANSFORM_H_ |
| 6 #define UI_GFX_TRANSFORM_H_ | 6 #define UI_GFX_TRANSFORM_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 // Returns the x and y translation components of the matrix. | 192 // Returns the x and y translation components of the matrix. |
| 193 Vector2dF To2dTranslation() const; | 193 Vector2dF To2dTranslation() const; |
| 194 | 194 |
| 195 // Applies the transformation to the point. | 195 // Applies the transformation to the point. |
| 196 void TransformPoint(Point3F* point) const; | 196 void TransformPoint(Point3F* point) const; |
| 197 | 197 |
| 198 // Applies the transformation to the point. | 198 // Applies the transformation to the point. |
| 199 void TransformPoint(Point* point) const; | 199 void TransformPoint(Point* point) const; |
| 200 | 200 |
| 201 // Applies the transformation to the vector. |
| 202 void TransformVector(Vector3dF* vector) const; |
| 203 |
| 201 // Applies the reverse transformation on the point. Returns true if the | 204 // Applies the reverse transformation on the point. Returns true if the |
| 202 // transformation can be inverted. | 205 // transformation can be inverted. |
| 203 bool TransformPointReverse(Point3F* point) const; | 206 bool TransformPointReverse(Point3F* point) const; |
| 204 | 207 |
| 205 // Applies the reverse transformation on the point. Returns true if the | 208 // Applies the reverse transformation on the point. Returns true if the |
| 206 // transformation can be inverted. Rounds the result to the nearest point. | 209 // transformation can be inverted. Rounds the result to the nearest point. |
| 207 bool TransformPointReverse(Point* point) const; | 210 bool TransformPointReverse(Point* point) const; |
| 208 | 211 |
| 209 // Applies transformation on the given rect. After the function completes, | 212 // Applies transformation on the given rect. After the function completes, |
| 210 // |rect| will be the smallest axis aligned bounding rect containing the | 213 // |rect| will be the smallest axis aligned bounding rect containing the |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 | 262 |
| 260 std::string ToString() const; | 263 std::string ToString() const; |
| 261 | 264 |
| 262 private: | 265 private: |
| 263 void TransformPointInternal(const SkMatrix44& xform, | 266 void TransformPointInternal(const SkMatrix44& xform, |
| 264 Point* point) const; | 267 Point* point) const; |
| 265 | 268 |
| 266 void TransformPointInternal(const SkMatrix44& xform, | 269 void TransformPointInternal(const SkMatrix44& xform, |
| 267 Point3F* point) const; | 270 Point3F* point) const; |
| 268 | 271 |
| 272 void TransformVectorInternal(const SkMatrix44& xform, |
| 273 Vector3dF* vector) const; |
| 274 |
| 269 SkMatrix44 matrix_; | 275 SkMatrix44 matrix_; |
| 270 | 276 |
| 271 // copy/assign are allowed. | 277 // copy/assign are allowed. |
| 272 }; | 278 }; |
| 273 | 279 |
| 274 // This is declared here for use in gtest-based unit tests but is defined in | 280 // This is declared here for use in gtest-based unit tests but is defined in |
| 275 // the gfx_test_support target. Depend on that to use this in your unit test. | 281 // the gfx_test_support target. Depend on that to use this in your unit test. |
| 276 // This should not be used in production code - call ToString() instead. | 282 // This should not be used in production code - call ToString() instead. |
| 277 void PrintTo(const Transform& transform, ::std::ostream* os); | 283 void PrintTo(const Transform& transform, ::std::ostream* os); |
| 278 | 284 |
| 279 } // namespace gfx | 285 } // namespace gfx |
| 280 | 286 |
| 281 #endif // UI_GFX_TRANSFORM_H_ | 287 #endif // UI_GFX_TRANSFORM_H_ |
| OLD | NEW |