Commit 671f646e authored by mlamouri@chromium.org's avatar mlamouri@chromium.org

Set gfx::Display rotation on Windows.

BUG=162827

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284889 0039d316-1c4b-4281-b951-d872f2087c98
parent e3b9d0be
......@@ -30,6 +30,32 @@ gfx::Display GetDisplay(MONITORINFOEX& monitor_info) {
gfx::Display display(id, bounds);
display.set_work_area(gfx::Rect(monitor_info.rcWork));
display.SetScaleAndBounds(gfx::win::GetDeviceScaleFactor(), bounds);
DEVMODE mode;
memset(&mode, 0, sizeof(DEVMODE));
mode.dmSize = sizeof(DEVMODE);
mode.dmDriverExtra = 0;
if (EnumDisplaySettings(monitor_info.szDevice,
ENUM_CURRENT_SETTINGS,
&mode)) {
switch (mode.dmDisplayOrientation) {
case DMDO_DEFAULT:
display.set_rotation(gfx::Display::ROTATE_0);
break;
case DMDO_90:
display.set_rotation(gfx::Display::ROTATE_90);
break;
case DMDO_180:
display.set_rotation(gfx::Display::ROTATE_180);
break;
case DMDO_270:
display.set_rotation(gfx::Display::ROTATE_270);
break;
default:
NOTREACHED();
}
}
return display;
}
......
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