Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1237)

Side by Side Diff: ui/gfx/geometry/point.h

Issue 1417023002: Remove some implicit Point to PointF conversions, add helpers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-views: extrachange Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « ui/gfx/geometry/dip_util.cc ('k') | ui/gfx/geometry/point.cc » ('j') | ui/gfx/geometry/point.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698