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

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

Issue 674763002: remove ui::gfx::GetDeviceScaleFactor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dpi-cleanup-3
Patch Set: rebase-4 Created 6 years, 1 month 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/canvas_paint_win.cc ('k') | ui/gfx/win/dpi.h » ('j') | 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/hash.h" 9 #include "base/hash.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 11 matching lines...) Expand all
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
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
OLDNEW
« no previous file with comments | « ui/gfx/canvas_paint_win.cc ('k') | ui/gfx/win/dpi.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698