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 22 matching lines...) Expand all Loading... |
33 Transform() : matrix_(SkMatrix44::kIdentity_Constructor) {} | 33 Transform() : matrix_(SkMatrix44::kIdentity_Constructor) {} |
34 | 34 |
35 // Skips initializing this matrix to avoid overhead, when we know it will be | 35 // Skips initializing this matrix to avoid overhead, when we know it will be |
36 // initialized before use. | 36 // initialized before use. |
37 Transform(SkipInitialization) | 37 Transform(SkipInitialization) |
38 : matrix_(SkMatrix44::kUninitialized_Constructor) {} | 38 : matrix_(SkMatrix44::kUninitialized_Constructor) {} |
39 Transform(const Transform& rhs) : matrix_(rhs.matrix_) {} | 39 Transform(const Transform& rhs) : matrix_(rhs.matrix_) {} |
40 // Initialize with the concatenation of lhs * rhs. | 40 // Initialize with the concatenation of lhs * rhs. |
41 Transform(const Transform& lhs, const Transform& rhs) | 41 Transform(const Transform& lhs, const Transform& rhs) |
42 : matrix_(lhs.matrix_, rhs.matrix_) {} | 42 : matrix_(lhs.matrix_, rhs.matrix_) {} |
| 43 explicit Transform(const SkMatrix44& matrix) : matrix_(matrix) {} |
43 // Constructs a transform from explicit 16 matrix elements. Elements | 44 // Constructs a transform from explicit 16 matrix elements. Elements |
44 // should be given in row-major order. | 45 // should be given in row-major order. |
45 Transform(SkMScalar col1row1, | 46 Transform(SkMScalar col1row1, |
46 SkMScalar col2row1, | 47 SkMScalar col2row1, |
47 SkMScalar col3row1, | 48 SkMScalar col3row1, |
48 SkMScalar col4row1, | 49 SkMScalar col4row1, |
49 SkMScalar col1row2, | 50 SkMScalar col1row2, |
50 SkMScalar col2row2, | 51 SkMScalar col2row2, |
51 SkMScalar col3row2, | 52 SkMScalar col3row2, |
52 SkMScalar col4row2, | 53 SkMScalar col4row2, |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 }; | 272 }; |
272 | 273 |
273 // This is declared here for use in gtest-based unit tests but is defined in | 274 // This is declared here for use in gtest-based unit tests but is defined in |
274 // the gfx_test_support target. Depend on that to use this in your unit test. | 275 // the gfx_test_support target. Depend on that to use this in your unit test. |
275 // This should not be used in production code - call ToString() instead. | 276 // This should not be used in production code - call ToString() instead. |
276 void PrintTo(const Transform& transform, ::std::ostream* os); | 277 void PrintTo(const Transform& transform, ::std::ostream* os); |
277 | 278 |
278 } // namespace gfx | 279 } // namespace gfx |
279 | 280 |
280 #endif // UI_GFX_TRANSFORM_H_ | 281 #endif // UI_GFX_TRANSFORM_H_ |
OLD | NEW |