OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // (i.e. 'this = this * transform;'). | 62 // (i.e. 'this = this * transform;'). |
63 void PreconcatTransform(const Transform& transform); | 63 void PreconcatTransform(const Transform& transform); |
64 | 64 |
65 // Applies a transformation on the current transformation | 65 // Applies a transformation on the current transformation |
66 // (i.e. 'this = transform * this;'). | 66 // (i.e. 'this = transform * this;'). |
67 void ConcatTransform(const Transform& transform); | 67 void ConcatTransform(const Transform& transform); |
68 | 68 |
69 // Does the transformation change anything? | 69 // Does the transformation change anything? |
70 bool HasChange() const; | 70 bool HasChange() const; |
71 | 71 |
| 72 // Inverts the transform. Returns true if successful; |
| 73 bool Invert(); |
| 74 |
72 // Applies the transformation on the point. Returns true if the point is | 75 // Applies the transformation on the point. Returns true if the point is |
73 // transformed successfully. | 76 // transformed successfully. |
74 void TransformPoint(gfx::Point3f& point) const; | 77 void TransformPoint(gfx::Point3f& point) const; |
75 | 78 |
76 // Applies the transformation on the point. Returns true if the point is | 79 // Applies the transformation on the point. Returns true if the point is |
77 // transformed successfully. Rounds the result to the nearest point. | 80 // transformed successfully. Rounds the result to the nearest point. |
78 void TransformPoint(gfx::Point& point) const; | 81 void TransformPoint(gfx::Point& point) const; |
79 | 82 |
80 // Applies the reverse transformation on the point. Returns true if the | 83 // Applies the reverse transformation on the point. Returns true if the |
81 // transformation can be inverted. | 84 // transformation can be inverted. |
(...skipping 26 matching lines...) Expand all Loading... |
108 gfx::Point3f& point) const; | 111 gfx::Point3f& point) const; |
109 | 112 |
110 SkMatrix44 matrix_; | 113 SkMatrix44 matrix_; |
111 | 114 |
112 // copy/assign are allowed. | 115 // copy/assign are allowed. |
113 }; | 116 }; |
114 | 117 |
115 }// namespace ui | 118 }// namespace ui |
116 | 119 |
117 #endif // UI_GFX_TRANSFORM_H_ | 120 #endif // UI_GFX_TRANSFORM_H_ |
OLD | NEW |