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_GEOMETRY_POINT_H_ | 5 #ifndef UI_GFX_GEOMETRY_POINT_H_ |
6 #define UI_GFX_GEOMETRY_POINT_H_ | 6 #define UI_GFX_GEOMETRY_POINT_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 inline Point PointAtOffsetFromOrigin(const Vector2d& offset_from_origin) { | 126 inline Point PointAtOffsetFromOrigin(const Vector2d& offset_from_origin) { |
127 return Point(offset_from_origin.x(), offset_from_origin.y()); | 127 return Point(offset_from_origin.x(), offset_from_origin.y()); |
128 } | 128 } |
129 | 129 |
130 // This is declared here for use in gtest-based unit tests but is defined in | 130 // This is declared here for use in gtest-based unit tests but is defined in |
131 // the gfx_test_support target. Depend on that to use this in your unit test. | 131 // the gfx_test_support target. Depend on that to use this in your unit test. |
132 // This should not be used in production code - call ToString() instead. | 132 // This should not be used in production code - call ToString() instead. |
133 void PrintTo(const Point& point, ::std::ostream* os); | 133 void PrintTo(const Point& point, ::std::ostream* os); |
134 | 134 |
| 135 // Helper methods to scale a gfx::Point to a new gfx::Point. |
| 136 GFX_EXPORT Point ScaleToCeiledPoint(const Point& point, |
| 137 float x_scale, |
| 138 float y_scale); |
| 139 GFX_EXPORT Point ScaleToCeiledPoint(const Point& point, float x_scale); |
| 140 GFX_EXPORT Point ScaleToFlooredPoint(const Point& point, |
| 141 float x_scale, |
| 142 float y_scale); |
| 143 GFX_EXPORT Point ScaleToFlooredPoint(const Point& point, float x_scale); |
| 144 GFX_EXPORT Point ScaleToRoundedPoint(const Point& point, |
| 145 float x_scale, |
| 146 float y_scale); |
| 147 GFX_EXPORT Point ScaleToRoundedPoint(const Point& point, float x_scale); |
| 148 |
135 } // namespace gfx | 149 } // namespace gfx |
136 | 150 |
137 #endif // UI_GFX_GEOMETRY_POINT_H_ | 151 #endif // UI_GFX_GEOMETRY_POINT_H_ |
OLD | NEW |