OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/win/screen_win_display.h" | 5 #include "ui/display/win/screen_win_display.h" |
6 | 6 |
7 #include "ui/gfx/win/display_info.h" | 7 #include "ui/display/win/display_info.h" |
8 #include "ui/gfx/win/dpi.h" | 8 #include "ui/gfx/win/dpi.h" |
9 | 9 |
| 10 namespace display { |
| 11 namespace win { |
| 12 |
10 namespace { | 13 namespace { |
11 | 14 |
12 gfx::Display CreateDisplayFromDisplayInfo( | 15 gfx::Display CreateDisplayFromDisplayInfo(const DisplayInfo& display_info) { |
13 const gfx::win::DisplayInfo& display_info) { | |
14 gfx::Display display(display_info.id()); | 16 gfx::Display display(display_info.id()); |
15 gfx::Rect dip_screen_bounds( | 17 gfx::Rect dip_screen_bounds( |
16 gfx::win::ScreenToDIPRect(display_info.screen_rect())); | 18 gfx::win::ScreenToDIPRect(display_info.screen_rect())); |
17 display.set_bounds(dip_screen_bounds); | 19 display.set_bounds(dip_screen_bounds); |
18 display.set_work_area( | 20 display.set_work_area( |
19 gfx::win::ScreenToDIPRect(display_info.screen_work_rect())); | 21 gfx::win::ScreenToDIPRect(display_info.screen_work_rect())); |
20 display.SetScaleAndBounds(display_info.device_scale_factor(), | 22 display.SetScaleAndBounds(display_info.device_scale_factor(), |
21 display_info.screen_rect()); | 23 display_info.screen_rect()); |
22 display.set_rotation(display_info.rotation()); | 24 display.set_rotation(display_info.rotation()); |
23 return display; | 25 return display; |
24 } | 26 } |
25 | 27 |
26 } // namespace | 28 } // namespace |
27 | 29 |
28 namespace gfx { | |
29 namespace win { | |
30 | |
31 ScreenWinDisplay::ScreenWinDisplay() = default; | 30 ScreenWinDisplay::ScreenWinDisplay() = default; |
32 | 31 |
33 ScreenWinDisplay::ScreenWinDisplay(const DisplayInfo& display_info) | 32 ScreenWinDisplay::ScreenWinDisplay(const DisplayInfo& display_info) |
34 : display_(CreateDisplayFromDisplayInfo(display_info)), | 33 : display_(CreateDisplayFromDisplayInfo(display_info)), |
35 pixel_bounds_(display_info.screen_rect()) {} | 34 pixel_bounds_(display_info.screen_rect()) {} |
36 | 35 |
37 } // namespace win | 36 } // namespace win |
38 } // namespace gfx | 37 } // namespace display |
OLD | NEW |