| Index: ui/gfx/display.cc
|
| diff --git a/ui/gfx/display.cc b/ui/gfx/display.cc
|
| index 40608a1d21127d265463131cb069199d6015942b..a5b386c8465f2f53dd9520b56331988adf3f38d3 100644
|
| --- a/ui/gfx/display.cc
|
| +++ b/ui/gfx/display.cc
|
| @@ -29,6 +29,13 @@ float GetForcedDeviceScaleFactorImpl() {
|
| if (!base::StringToDouble(value, &scale_in_double))
|
| LOG(ERROR) << "Failed to parse the default device scale factor:" << value;
|
| }
|
| +#if defined(OS_WIN)
|
| + else {
|
| + static double os_scale = ui::GetDPIScale();
|
| + scale_in_double = os_scale;
|
| + }
|
| +#endif
|
| +
|
| return static_cast<float>(scale_in_double);
|
| }
|
|
|
| @@ -42,12 +49,12 @@ float Display::GetForcedDeviceScaleFactor() {
|
| GetForcedDeviceScaleFactorImpl();
|
| return kForcedDeviceScaleFactor;
|
| }
|
| -
|
| //static
|
| bool Display::HasForceDeviceScaleFactor() {
|
| return HasForceDeviceScaleFactorImpl();
|
| }
|
|
|
| +
|
| // static
|
| int64 Display::GetID(uint16 manufacturer_id,
|
| uint16 product_code,
|
| @@ -73,7 +80,7 @@ Display::Display(int64 id, const gfx::Rect& bounds)
|
| bounds_(bounds),
|
| work_area_(bounds),
|
| device_scale_factor_(GetForcedDeviceScaleFactor()) {
|
| -#if defined(USE_AURA)
|
| +#if defined(USE_AURA) // || defined(OS_WIN)
|
| SetScaleAndBounds(device_scale_factor_, bounds);
|
| #endif
|
| }
|
| @@ -101,7 +108,7 @@ void Display::SetScaleAndBounds(
|
| device_scale_factor_ = device_scale_factor;
|
| }
|
| device_scale_factor_ = std::max(1.0f, device_scale_factor_);
|
| -#if defined(USE_AURA)
|
| +#if defined(USE_AURA) || defined(OS_WIN)
|
| bounds_in_pixel_ = bounds_in_pixel;
|
| #endif
|
| bounds_ = gfx::Rect(gfx::ToFlooredSize(
|
| @@ -112,7 +119,7 @@ void Display::SetScaleAndBounds(
|
| void Display::SetSize(const gfx::Size& size_in_pixel) {
|
| SetScaleAndBounds(
|
| device_scale_factor_,
|
| -#if defined(USE_AURA)
|
| +#if defined(USE_AURA) || defined(OS_WIN)
|
| gfx::Rect(bounds_in_pixel_.origin(), size_in_pixel));
|
| #else
|
| gfx::Rect(bounds_.origin(), size_in_pixel));
|
|
|