| 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 #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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // Applies the reverse transformation on the point. Returns true if the | 94 // Applies the reverse transformation on the point. Returns true if the |
| 95 // transformation can be inverted. | 95 // transformation can be inverted. |
| 96 bool TransformPointReverse(gfx::Point3f& point) const; | 96 bool TransformPointReverse(gfx::Point3f& point) const; |
| 97 | 97 |
| 98 // Applies the reverse transformation on the point. Returns true if the | 98 // Applies the reverse transformation on the point. Returns true if the |
| 99 // transformation can be inverted. Rounds the result to the nearest point. | 99 // transformation can be inverted. Rounds the result to the nearest point. |
| 100 bool TransformPointReverse(gfx::Point& point) const; | 100 bool TransformPointReverse(gfx::Point& point) const; |
| 101 | 101 |
| 102 // Applies transformation on the rectangle. Returns true if the transformed | 102 // Applies transformation on the rectangle. Returns true if the transformed |
| 103 // rectangle was axis aligned. If it returns false, rect will be the | 103 // rectangle was axis aligned. If it returns false, rect will be the |
| 104 // smallest axis aligned bounding box containing the transformed rect. | 104 // smallest axis aligned bounding box containg the transformed rect. |
| 105 void TransformRect(gfx::Rect* rect) const; | 105 void TransformRect(gfx::Rect* rect) const; |
| 106 | 106 |
| 107 // Applies the reverse transformation on the rectangle. Returns true if | 107 // Applies the reverse transformation on the rectangle. Returns true if |
| 108 // the transformed rectangle was axis aligned. If it returns false, | 108 // the transformed rectangle was axis aligned. If it returns false, |
| 109 // rect will be the smallest axis aligned bounding box containing the | 109 // rect will be the smallest axis aligned bounding box containg the |
| 110 // transformed rect. | 110 // transformed rect. |
| 111 bool TransformRectReverse(gfx::Rect* rect) const; | 111 bool TransformRectReverse(gfx::Rect* rect) const; |
| 112 | 112 |
| 113 // Returns the underlying matrix. | 113 // Returns the underlying matrix. |
| 114 const SkMatrix44& matrix() const { return matrix_; } | 114 const SkMatrix44& matrix() const { return matrix_; } |
| 115 SkMatrix44& matrix() { return matrix_; } | 115 SkMatrix44& matrix() { return matrix_; } |
| 116 | 116 |
| 117 private: | 117 private: |
| 118 void TransformPointInternal(const SkMatrix44& xform, | 118 void TransformPointInternal(const SkMatrix44& xform, |
| 119 gfx::Point& point) const; | 119 gfx::Point& point) const; |
| 120 | 120 |
| 121 void TransformPointInternal(const SkMatrix44& xform, | 121 void TransformPointInternal(const SkMatrix44& xform, |
| 122 gfx::Point3f& point) const; | 122 gfx::Point3f& point) const; |
| 123 | 123 |
| 124 SkMatrix44 matrix_; | 124 SkMatrix44 matrix_; |
| 125 | 125 |
| 126 // copy/assign are allowed. | 126 // copy/assign are allowed. |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 }// namespace ui | 129 }// namespace ui |
| 130 | 130 |
| 131 #endif // UI_GFX_TRANSFORM_H_ | 131 #endif // UI_GFX_TRANSFORM_H_ |
| OLD | NEW |