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

Unified Diff: ui/gfx/display.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/display.cc
diff --git a/ui/gfx/display.cc b/ui/gfx/display.cc
index 27f757607be9e47eee6c6b6734a944260116a881..0125440e3bc11e501e892b0394fb1b2d4c9c701a 100644
--- a/ui/gfx/display.cc
+++ b/ui/gfx/display.cc
@@ -159,20 +159,17 @@ void Display::SetScaleAndBounds(
device_scale_factor_ = device_scale_factor;
}
device_scale_factor_ = std::max(1.0f, device_scale_factor_);
- bounds_ =
- gfx::Rect(gfx::ToFlooredPoint(gfx::ScalePoint(
- bounds_in_pixel.origin(), 1.0f / device_scale_factor_)),
- gfx::ScaleToFlooredSize(bounds_in_pixel.size(),
- 1.0f / device_scale_factor_));
+ bounds_ = gfx::Rect(gfx::ScaleToFlooredPoint(bounds_in_pixel.origin(),
+ 1.0f / device_scale_factor_),
+ gfx::ScaleToFlooredSize(bounds_in_pixel.size(),
+ 1.0f / device_scale_factor_));
UpdateWorkAreaFromInsets(insets);
}
void Display::SetSize(const gfx::Size& size_in_pixel) {
gfx::Point origin = bounds_.origin();
#if defined(USE_AURA)
- gfx::PointF origin_f = origin;
- origin_f.Scale(device_scale_factor_);
- origin = gfx::ToFlooredPoint(origin_f);
+ origin = gfx::ScaleToFlooredPoint(origin, device_scale_factor_);
#endif
SetScaleAndBounds(device_scale_factor_, gfx::Rect(origin, size_in_pixel));
}
« no previous file with comments | « ui/base/x/x11_util.cc ('k') | ui/gfx/geometry/dip_util.cc » ('j') | ui/gfx/geometry/point.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698