| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gfx/screen_win.h" | 5 #include "ui/gfx/screen_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/hash.h" | 9 #include "base/hash.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 GetMonitorInfo(monitor, &monitor_info); | 22 GetMonitorInfo(monitor, &monitor_info); |
| 23 return monitor_info; | 23 return monitor_info; |
| 24 } | 24 } |
| 25 | 25 |
| 26 gfx::Display GetDisplay(MONITORINFOEX& monitor_info) { | 26 gfx::Display GetDisplay(MONITORINFOEX& monitor_info) { |
| 27 int64 id = static_cast<int64>( | 27 int64 id = static_cast<int64>( |
| 28 base::Hash(base::WideToUTF8(monitor_info.szDevice))); | 28 base::Hash(base::WideToUTF8(monitor_info.szDevice))); |
| 29 gfx::Rect bounds = gfx::Rect(monitor_info.rcMonitor); | 29 gfx::Rect bounds = gfx::Rect(monitor_info.rcMonitor); |
| 30 gfx::Display display(id, bounds); | 30 gfx::Display display(id, bounds); |
| 31 display.set_work_area(gfx::Rect(monitor_info.rcWork)); | 31 display.set_work_area(gfx::Rect(monitor_info.rcWork)); |
| 32 display.SetScaleAndBounds(gfx::win::GetDeviceScaleFactor(), bounds); | 32 display.SetScaleAndBounds(gfx::GetDPIScale(), bounds); |
| 33 | 33 |
| 34 DEVMODE mode; | 34 DEVMODE mode; |
| 35 memset(&mode, 0, sizeof(DEVMODE)); | 35 memset(&mode, 0, sizeof(DEVMODE)); |
| 36 mode.dmSize = sizeof(DEVMODE); | 36 mode.dmSize = sizeof(DEVMODE); |
| 37 mode.dmDriverExtra = 0; | 37 mode.dmDriverExtra = 0; |
| 38 if (EnumDisplaySettings(monitor_info.szDevice, | 38 if (EnumDisplaySettings(monitor_info.szDevice, |
| 39 ENUM_CURRENT_SETTINGS, | 39 ENUM_CURRENT_SETTINGS, |
| 40 &mode)) { | 40 &mode)) { |
| 41 switch (mode.dmDisplayOrientation) { | 41 switch (mode.dmDisplayOrientation) { |
| 42 case DMDO_DEFAULT: | 42 case DMDO_DEFAULT: |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 NOTREACHED(); | 192 NOTREACHED(); |
| 193 return NULL; | 193 return NULL; |
| 194 } | 194 } |
| 195 | 195 |
| 196 NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { | 196 NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { |
| 197 NOTREACHED(); | 197 NOTREACHED(); |
| 198 return NULL; | 198 return NULL; |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace gfx | 201 } // namespace gfx |
| OLD | NEW |