Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: ui/gfx/screen_win.cc

Issue 12398019: Set the scale factor for the display on Windows when in high-DPI mode. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/display.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/logging.h" 9 #include "base/logging.h"
10 #include "ui/base/win/dpi.h"
10 #include "ui/gfx/display.h" 11 #include "ui/gfx/display.h"
11 12
12 namespace { 13 namespace {
13 14
14 MONITORINFO GetMonitorInfoForMonitor(HMONITOR monitor) { 15 MONITORINFO GetMonitorInfoForMonitor(HMONITOR monitor) {
15 MONITORINFO monitor_info = { 0 }; 16 MONITORINFO monitor_info = { 0 };
16 monitor_info.cbSize = sizeof(monitor_info); 17 monitor_info.cbSize = sizeof(monitor_info);
17 GetMonitorInfo(monitor, &monitor_info); 18 GetMonitorInfo(monitor, &monitor_info);
18 return monitor_info; 19 return monitor_info;
19 } 20 }
20 21
21 gfx::Display GetDisplay(MONITORINFO& monitor_info) { 22 gfx::Display GetDisplay(MONITORINFO& monitor_info) {
22 // TODO(oshima): Implement ID and Observer. 23 // TODO(oshima): Implement ID and Observer.
23 gfx::Display display(0, gfx::Rect(monitor_info.rcMonitor)); 24 gfx::Display display(0, gfx::Rect(monitor_info.rcMonitor));
oshima 2013/03/04 22:12:02 Oh, wait. So this was wrong? Or size of rcMonitor
24 display.set_work_area(gfx::Rect(monitor_info.rcWork)); 25 gfx::Rect work_area = gfx::Rect(monitor_info.rcWork);
26 display.set_work_area(work_area);
27 display.SetScaleAndBounds(ui::win::GetDeviceScaleFactor(), work_area);
oshima 2013/03/04 19:34:25 I believe you need to pass the display's bound (in
kevers 2013/03/04 20:02:14 For Windows, the scale factor is fixed across all
girard 2013/03/04 21:53:45 The "work area" on windows is the area excluding O
25 return display; 28 return display;
26 } 29 }
27 30
28 } // namespace 31 } // namespace
29 32
30 namespace gfx { 33 namespace gfx {
31 34
32 ScreenWin::ScreenWin() { 35 ScreenWin::ScreenWin() {
33 } 36 }
34 37
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 #endif // USE_AURA 134 #endif // USE_AURA
132 } 135 }
133 136
134 #if !defined(USE_AURA) 137 #if !defined(USE_AURA)
135 Screen* CreateNativeScreen() { 138 Screen* CreateNativeScreen() {
136 return new ScreenWin; 139 return new ScreenWin;
137 } 140 }
138 #endif // !USE_AURA 141 #endif // !USE_AURA
139 142
140 } // namespace gfx 143 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/display.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698