Commit a9d8ec82 authored by enne's avatar enne Committed by Commit bot

Fix --force-device-scale-factor on Mac

Previously, Display would read the device scale factor from the command
line in its ctor, but then screen would clobber it.  This meant that
the force device scale factor command line flag was silently ignored.

R=oshima@chromium.org,ccameron@chromium.org

Review URL: https://codereview.chromium.org/1111543003

Cr-Commit-Position: refs/heads/master@{#327211}
parent 9c1eef33
...@@ -75,6 +75,10 @@ gfx::Display GetDisplayForScreen(NSScreen* screen) { ...@@ -75,6 +75,10 @@ gfx::Display GetDisplayForScreen(NSScreen* screen) {
scale = [screen backingScaleFactor]; scale = [screen backingScaleFactor];
else else
scale = [screen userSpaceScaleFactor]; scale = [screen userSpaceScaleFactor];
if (gfx::Display::HasForceDeviceScaleFactor())
scale = gfx::Display::GetForcedDeviceScaleFactor();
display.set_device_scale_factor(scale); display.set_device_scale_factor(scale);
// CGDisplayRotation returns a double. Display::SetRotationAsDegree will // CGDisplayRotation returns a double. Display::SetRotationAsDegree will
// handle the unexpected situations were the angle is not a multiple of 90. // handle the unexpected situations were the angle is not a multiple of 90.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment