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" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // Applies a transformation on the current transformation | 66 // Applies a transformation on the current transformation |
67 // (i.e. 'this = transform * this;'). | 67 // (i.e. 'this = transform * this;'). |
68 void ConcatTransform(const Transform& transform); | 68 void ConcatTransform(const Transform& transform); |
69 | 69 |
70 // Returns true if this is the identity matrix. | 70 // Returns true if this is the identity matrix. |
71 bool IsIdentity() const; | 71 bool IsIdentity() const; |
72 | 72 |
73 // Returns true if the matrix is either identity or pure translation. | 73 // Returns true if the matrix is either identity or pure translation. |
74 bool IsIdentityOrTranslation() const; | 74 bool IsIdentityOrTranslation() const; |
75 | 75 |
| 76 // Returns true if the matrix is either identity or pure, non-fractional |
| 77 // translation. |
| 78 bool IsIdentityOrIntegerTranslation() const; |
| 79 |
76 // Returns true if the matrix is has only scaling and translation components. | 80 // Returns true if the matrix is has only scaling and translation components. |
77 bool IsScaleOrTranslation() const; | 81 bool IsScaleOrTranslation() const; |
78 | 82 |
79 // Returns true if the matrix has any perspective component that would | 83 // Returns true if the matrix has any perspective component that would |
80 // change the w-component of a homogeneous point. | 84 // change the w-component of a homogeneous point. |
81 bool HasPerspective() const; | 85 bool HasPerspective() const; |
82 | 86 |
83 // Returns true if this transform is non-singular. | 87 // Returns true if this transform is non-singular. |
84 bool IsInvertible() const; | 88 bool IsInvertible() const; |
85 | 89 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 Point3F& point) const; | 153 Point3F& point) const; |
150 | 154 |
151 SkMatrix44 matrix_; | 155 SkMatrix44 matrix_; |
152 | 156 |
153 // copy/assign are allowed. | 157 // copy/assign are allowed. |
154 }; | 158 }; |
155 | 159 |
156 } // namespace gfx | 160 } // namespace gfx |
157 | 161 |
158 #endif // UI_GFX_TRANSFORM_H_ | 162 #endif // UI_GFX_TRANSFORM_H_ |
OLD | NEW |