Chromium Code Reviews| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 SkMScalar col4row4); | 61 SkMScalar col4row4); |
| 62 // Constructs a transform from explicit 2d elements. All other matrix | 62 // Constructs a transform from explicit 2d elements. All other matrix |
| 63 // elements remain the same as the corresponding elements of an identity | 63 // elements remain the same as the corresponding elements of an identity |
| 64 // matrix. | 64 // matrix. |
| 65 Transform(SkMScalar col1row1, | 65 Transform(SkMScalar col1row1, |
| 66 SkMScalar col2row1, | 66 SkMScalar col2row1, |
| 67 SkMScalar col1row2, | 67 SkMScalar col1row2, |
| 68 SkMScalar col2row2, | 68 SkMScalar col2row2, |
| 69 SkMScalar x_translation, | 69 SkMScalar x_translation, |
| 70 SkMScalar y_translation); | 70 SkMScalar y_translation); |
| 71 ~Transform() {} | |
|
Ian Vollick
2016/07/02 01:26:06
Is this related to the other changes, or is it jus
| |
| 72 | 71 |
| 73 bool operator==(const Transform& rhs) const { return matrix_ == rhs.matrix_; } | 72 bool operator==(const Transform& rhs) const { return matrix_ == rhs.matrix_; } |
| 74 bool operator!=(const Transform& rhs) const { return matrix_ != rhs.matrix_; } | 73 bool operator!=(const Transform& rhs) const { return matrix_ != rhs.matrix_; } |
| 75 | 74 |
| 76 // Resets this transform to the identity transform. | 75 // Resets this transform to the identity transform. |
| 77 void MakeIdentity() { matrix_.setIdentity(); } | 76 void MakeIdentity() { matrix_.setIdentity(); } |
| 78 | 77 |
| 79 // Applies the current transformation on a 2d rotation and assigns the result | 78 // Applies the current transformation on a 2d rotation and assigns the result |
| 80 // to |this|. | 79 // to |this|. |
| 81 void Rotate(double degrees) { RotateAboutZAxis(degrees); } | 80 void Rotate(double degrees) { RotateAboutZAxis(degrees); } |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 278 }; | 277 }; |
| 279 | 278 |
| 280 // This is declared here for use in gtest-based unit tests but is defined in | 279 // This is declared here for use in gtest-based unit tests but is defined in |
| 281 // the gfx_test_support target. Depend on that to use this in your unit test. | 280 // the gfx_test_support target. Depend on that to use this in your unit test. |
| 282 // This should not be used in production code - call ToString() instead. | 281 // This should not be used in production code - call ToString() instead. |
| 283 void PrintTo(const Transform& transform, ::std::ostream* os); | 282 void PrintTo(const Transform& transform, ::std::ostream* os); |
| 284 | 283 |
| 285 } // namespace gfx | 284 } // namespace gfx |
| 286 | 285 |
| 287 #endif // UI_GFX_TRANSFORM_H_ | 286 #endif // UI_GFX_TRANSFORM_H_ |
| OLD | NEW |