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

Unified Diff: ash/display/display_info.cc

Issue 417113012: Introduce user customization of external HighDPI mode for 4K monitor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: polish Created 6 years, 5 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: ash/display/display_info.cc
diff --git a/ash/display/display_info.cc b/ash/display/display_info.cc
index 087f0a36a878b49b61310939c28083129c2f8e32..73395dd10ccc345e185bacc84162866b559b5f36 100644
--- a/ash/display/display_info.cc
+++ b/ash/display/display_info.cc
@@ -29,7 +29,11 @@ bool allow_upgrade_to_high_dpi = false;
}
DisplayMode::DisplayMode()
- : refresh_rate(0.0f), interlaced(false), native(false) {}
+ : refresh_rate(0.0f),
+ interlaced(false),
+ native(false),
+ ui_scale(1.0f),
+ device_scale_factor(1.0f) {}
DisplayMode::DisplayMode(const gfx::Size& size,
float refresh_rate,
@@ -38,7 +42,16 @@ DisplayMode::DisplayMode(const gfx::Size& size,
: size(size),
refresh_rate(refresh_rate),
interlaced(interlaced),
- native(native) {}
+ native(native),
+ ui_scale(1.0f),
+ device_scale_factor(1.0f) {}
+
+gfx::Size DisplayMode::GetSizeInDIP() const {
+ gfx::SizeF size_dip(size);
+ size_dip.Scale(ui_scale);
+ size_dip.Scale(1.0f / device_scale_factor);
+ return gfx::ToFlooredSize(size_dip);
+}
// satic
DisplayInfo DisplayInfo::CreateFromSpec(const std::string& spec) {

Powered by Google App Engine
This is Rietveld 408576698