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

Unified Diff: ui/gfx/display.cc

Issue 1426933002: Refactor Windows DPI Point, Rect, and Size for Multiple Monitor DPI Awareness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR Feedback 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 0125440e3bc11e501e892b0394fb1b2d4c9c701a..59e28a537e84f57d3bb7620eb82f5e602ef8223d 100644
--- a/ui/gfx/display.cc
+++ b/ui/gfx/display.cc
@@ -159,10 +159,18 @@ void Display::SetScaleAndBounds(
device_scale_factor_ = device_scale_factor;
}
device_scale_factor_ = std::max(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_));
+ bounds_ =
+#if defined(OS_WIN)
+ // Origins are fixed in Windows in both Screen and DIP.
+ gfx::Rect(bounds_in_pixel.origin(),
+ gfx::ScaleToFlooredSize(bounds_in_pixel.size(),
+ 1.0f / device_scale_factor_));
+#else
+ gfx::Rect(gfx::ScaleToFlooredPoint(bounds_in_pixel.origin(),
+ 1.0f / device_scale_factor_),
+ gfx::ScaleToFlooredSize(bounds_in_pixel.size(),
+ 1.0f / device_scale_factor_));
+#endif // defined(OS_WIN)
UpdateWorkAreaFromInsets(insets);
}

Powered by Google App Engine
This is Rietveld 408576698