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

Unified Diff: ui/gfx/geometry/dip_util.cc

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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/geometry/dip_util.cc
diff --git a/ui/gfx/geometry/dip_util.cc b/ui/gfx/geometry/dip_util.cc
index f478f81bd88dc8d16cdbd35dba8bd0807ad2a9fb..c1efdf5e414f25e444796d104d1e1ceaf3971a96 100644
--- a/ui/gfx/geometry/dip_util.cc
+++ b/ui/gfx/geometry/dip_util.cc
@@ -15,7 +15,7 @@
namespace gfx {
Point ConvertPointToDIP(float scale_factor, const Point& point_in_pixel) {
- return ToFlooredPoint(ScalePoint(point_in_pixel, 1.0f / scale_factor));
+ return ScaleToFlooredPoint(point_in_pixel, 1.0f / scale_factor);
}
PointF ConvertPointToDIP(float scale_factor, const PointF& point_in_pixel) {
@@ -32,7 +32,7 @@ Rect ConvertRectToDIP(float scale_factor, const Rect& rect_in_pixel) {
}
Point ConvertPointToPixel(float scale_factor, const Point& point_in_dip) {
- return ToFlooredPoint(ScalePoint(point_in_dip, scale_factor));
+ return ScaleToFlooredPoint(point_in_dip, scale_factor);
}
Size ConvertSizeToPixel(float scale_factor, const Size& size_in_dip) {
@@ -46,7 +46,7 @@ Rect ConvertRectToPixel(float scale_factor, const Rect& rect_in_dip) {
// results in rounding down and not drawing all the pixels that are
// touched.
return ToEnclosingRect(
- RectF(ScalePoint(rect_in_dip.origin(), scale_factor),
+ RectF(ScalePoint(gfx::PointF(rect_in_dip.origin()), scale_factor),
ScaleSize(gfx::SizeF(rect_in_dip.size()), scale_factor)));
}
« no previous file with comments | « ui/gfx/display.cc ('k') | ui/gfx/geometry/point.h » ('j') | ui/gfx/geometry/point.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698