Upstream version 10.38.220.0
[platform/framework/web/crosswalk.git] / src / ash / display / display_info.cc
index dc37650..48e646e 100644 (file)
@@ -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;