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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // Applies the current transformation on a scaling and assigns the result | 89 // Applies the current transformation on a scaling and assigns the result |
90 // to |this|. | 90 // to |this|. |
91 void Scale(SkMScalar x, SkMScalar y); | 91 void Scale(SkMScalar x, SkMScalar y); |
92 void Scale3d(SkMScalar x, SkMScalar y, SkMScalar z); | 92 void Scale3d(SkMScalar x, SkMScalar y, SkMScalar z); |
93 gfx::Vector2dF Scale2d() const { | 93 gfx::Vector2dF Scale2d() const { |
94 return gfx::Vector2dF(matrix_.get(0, 0), matrix_.get(1, 1)); | 94 return gfx::Vector2dF(matrix_.get(0, 0), matrix_.get(1, 1)); |
95 } | 95 } |
96 | 96 |
97 // Applies the current transformation on a translation and assigns the result | 97 // Applies the current transformation on a translation and assigns the result |
98 // to |this|. | 98 // to |this|. |
| 99 void Translate(const Vector2dF& offset); |
99 void Translate(SkMScalar x, SkMScalar y); | 100 void Translate(SkMScalar x, SkMScalar y); |
| 101 void Translate3d(const Vector3dF& offset); |
100 void Translate3d(SkMScalar x, SkMScalar y, SkMScalar z); | 102 void Translate3d(SkMScalar x, SkMScalar y, SkMScalar z); |
101 | 103 |
102 // Applies the current transformation on a skew and assigns the result | 104 // Applies the current transformation on a skew and assigns the result |
103 // to |this|. | 105 // to |this|. |
104 void Skew(double angle_x, double angle_y); | 106 void Skew(double angle_x, double angle_y); |
105 | 107 |
106 // Applies the current transformation on a perspective transform and assigns | 108 // Applies the current transformation on a perspective transform and assigns |
107 // the result to |this|. | 109 // the result to |this|. |
108 void ApplyPerspectiveDepth(SkMScalar depth); | 110 void ApplyPerspectiveDepth(SkMScalar depth); |
109 | 111 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 }; | 279 }; |
278 | 280 |
279 // This is declared here for use in gtest-based unit tests but is defined in | 281 // This is declared here for use in gtest-based unit tests but is defined in |
280 // the //ui/gfx:test_support target. Depend on that to use this in your unit | 282 // the //ui/gfx:test_support target. Depend on that to use this in your unit |
281 // test. This should not be used in production code - call ToString() instead. | 283 // test. This should not be used in production code - call ToString() instead. |
282 void PrintTo(const Transform& transform, ::std::ostream* os); | 284 void PrintTo(const Transform& transform, ::std::ostream* os); |
283 | 285 |
284 } // namespace gfx | 286 } // namespace gfx |
285 | 287 |
286 #endif // UI_GFX_TRANSFORM_H_ | 288 #endif // UI_GFX_TRANSFORM_H_ |
OLD | NEW |