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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "third_party/skia/include/utils/SkMatrix44.h" | 9 #include "third_party/skia/include/utils/SkMatrix44.h" |
10 #include "ui/base/ui_export.h" | 10 #include "ui/base/ui_export.h" |
11 | 11 |
12 namespace gfx { | 12 namespace gfx { |
13 | 13 |
14 class RectF; | 14 class RectF; |
15 class Point; | 15 class Point; |
16 class Point3F; | 16 class Point3F; |
17 class Vector3dF; | 17 class Vector3dF; |
18 | 18 |
19 // 4x4 transformation matrix. Transform is cheap and explicitly allows | 19 // 4x4 transformation matrix. Transform is cheap and explicitly allows |
20 // copy/assign. | 20 // copy/assign. |
21 class UI_EXPORT Transform { | 21 class UI_EXPORT Transform { |
22 public: | 22 public: |
23 | |
24 enum SkipInitialization { | |
25 kSkipInitialization | |
danakj
2012/12/19 05:23:06
Wishing for shorter synonym for this, but I got no
| |
26 }; | |
27 | |
23 Transform() : matrix_(SkMatrix44::kIdentity_Constructor) {} | 28 Transform() : matrix_(SkMatrix44::kIdentity_Constructor) {} |
29 Transform(SkipInitialization) | |
30 : matrix_(SkMatrix44::kUninitialized_Constructor) {} | |
24 Transform(const Transform& rhs) : matrix_(rhs.matrix_) {} | 31 Transform(const Transform& rhs) : matrix_(rhs.matrix_) {} |
25 // Initialize with the concatenation of lhs * rhs. | 32 // Initialize with the concatenation of lhs * rhs. |
26 Transform(const Transform& lhs, const Transform& rhs) | 33 Transform(const Transform& lhs, const Transform& rhs) |
27 : matrix_(lhs.matrix_, rhs.matrix_) {} | 34 : matrix_(lhs.matrix_, rhs.matrix_) {} |
28 ~Transform() {} | 35 ~Transform() {} |
29 | 36 |
30 bool operator==(const Transform& rhs) const { return matrix_ == rhs.matrix_; } | 37 bool operator==(const Transform& rhs) const { return matrix_ == rhs.matrix_; } |
31 bool operator!=(const Transform& rhs) const { return matrix_ != rhs.matrix_; } | 38 bool operator!=(const Transform& rhs) const { return matrix_ != rhs.matrix_; } |
32 | 39 |
33 // Resets this transform to the identity transform. | 40 // Resets this transform to the identity transform. |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
169 Point3F& point) const; | 176 Point3F& point) const; |
170 | 177 |
171 SkMatrix44 matrix_; | 178 SkMatrix44 matrix_; |
172 | 179 |
173 // copy/assign are allowed. | 180 // copy/assign are allowed. |
174 }; | 181 }; |
175 | 182 |
176 } // namespace gfx | 183 } // namespace gfx |
177 | 184 |
178 #endif // UI_GFX_TRANSFORM_H_ | 185 #endif // UI_GFX_TRANSFORM_H_ |
OLD | NEW |