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

Unified Diff: ash/display/display_info.cc

Issue 578553002: Use DSF instead of UI scale if the native DSF is 1.25 and UI Scale is 0.8x (dsf=1.25 equivalent) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 72d256e47bf36a8ada7a7db0e9baf8519cba0041..f8adf5369ab3ccf2166c594c1c389c3bde03e288 100644
--- a/ash/display/display_info.cc
+++ b/ash/display/display_info.cc
@@ -26,6 +26,8 @@ namespace {
// TODO(oshima): This feature is obsolete. Remove this after m38.
bool allow_upgrade_to_high_dpi = false;
+bool use_125_dsf_for_ui_scaling = false;
+
// Check the content of |spec| and fill |bounds| and |device_scale_factor|.
// Returns true when |bounds| is found.
bool GetDisplayBounds(
@@ -89,6 +91,11 @@ void DisplayInfo::SetAllowUpgradeToHighDPI(bool enable) {
}
// static
+void DisplayInfo::SetUse125DSFForUIScaling(bool enable) {
+ use_125_dsf_for_ui_scaling = enable;
+}
+
+// static
DisplayInfo DisplayInfo::CreateFromSpecWithID(const std::string& spec,
int64 id) {
// Default bounds for a display.
@@ -283,6 +290,9 @@ void DisplayInfo::SetBounds(const gfx::Rect& new_bounds_in_native) {
}
float DisplayInfo::GetEffectiveDeviceScaleFactor() const {
+ if (use_125_dsf_for_ui_scaling && device_scale_factor_ == 1.25f)
+ return configured_ui_scale_ == 0.8f ? 1.25f : 1.0f;
+
if (allow_upgrade_to_high_dpi && configured_ui_scale_ < 1.0f &&
device_scale_factor_ == 1.0f) {
return 2.0f;
@@ -293,6 +303,9 @@ float DisplayInfo::GetEffectiveDeviceScaleFactor() const {
}
float DisplayInfo::GetEffectiveUIScale() const {
+ if (use_125_dsf_for_ui_scaling && device_scale_factor_ == 1.25f)
+ return configured_ui_scale_ == 0.8f ? 1.0f : configured_ui_scale_;
+
if (allow_upgrade_to_high_dpi && configured_ui_scale_ < 1.0f &&
device_scale_factor_ == 1.0f) {
return configured_ui_scale_ * 2.0f;

Powered by Google App Engine
This is Rietveld 408576698