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

Unified Diff: ui/views/widget/desktop_aura/desktop_screen_x11.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/views/widget/desktop_aura/desktop_screen_x11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_screen_x11.cc b/ui/views/widget/desktop_aura/desktop_screen_x11.cc
index 827f294f4d0ee05190c400393f200e94726e5196..221465432a889d0b32d0c3f1eae502acfc4bb0e5 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_x11.cc
@@ -45,11 +45,11 @@ double GetDeviceScaleFactor() {
}
gfx::Point PixelToDIPPoint(const gfx::Point& pixel_point) {
- return ToFlooredPoint(ScalePoint(pixel_point, 1.0f / GetDeviceScaleFactor()));
+ return gfx::ScaleToFlooredPoint(pixel_point, 1.0f / GetDeviceScaleFactor());
}
gfx::Point DIPToPixelPoint(const gfx::Point& dip_point) {
- return ToFlooredPoint(gfx::ScalePoint(dip_point, GetDeviceScaleFactor()));
+ return gfx::ScaleToFlooredPoint(dip_point, GetDeviceScaleFactor());
}
std::vector<gfx::Display> GetFallbackDisplayList() {
@@ -322,9 +322,8 @@ std::vector<gfx::Display> DesktopScreenX11::BuildDisplaysFromXRandRInfo() {
// SetScaleAndBounds() above does the conversion from pixels to DIP for
// us, but set_work_area does not, so we need to do it here.
display.set_work_area(gfx::Rect(
- gfx::ToFlooredPoint(
- gfx::ScalePoint(intersection_in_pixels.origin(),
- 1.0f / display.device_scale_factor())),
+ gfx::ScaleToFlooredPoint(intersection_in_pixels.origin(),
+ 1.0f / display.device_scale_factor()),
gfx::ScaleToFlooredSize(intersection_in_pixels.size(),
1.0f / display.device_scale_factor())));
}

Powered by Google App Engine
This is Rietveld 408576698