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

Side by Side Diff: ash/display/display_info.cc

Issue 1889423002: Move Windows DPI Code from ui/gfx to ui/display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a TODO Created 4 years, 8 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 | « no previous file | chrome/app/chrome_exe_main_win.cc » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ash/display/display_info.h" 5 #include "ash/display/display_info.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
15 #include "base/strings/string_split.h" 15 #include "base/strings/string_split.h"
16 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
17 #include "base/strings/stringprintf.h" 17 #include "base/strings/stringprintf.h"
18 #include "ui/gfx/display.h" 18 #include "ui/gfx/display.h"
19 #include "ui/gfx/geometry/size_conversions.h" 19 #include "ui/gfx/geometry/size_conversions.h"
20 #include "ui/gfx/geometry/size_f.h" 20 #include "ui/gfx/geometry/size_f.h"
21 21
22 #if defined(OS_WIN) 22 #if defined(OS_WIN)
23 #include "ui/aura/window_tree_host.h" 23 #include "ui/aura/window_tree_host.h"
24 #include "ui/gfx/win/dpi.h" 24 #include "ui/display/win/dpi.h"
25 #endif 25 #endif
26 26
27 namespace ash { 27 namespace ash {
28 namespace { 28 namespace {
29 29
30 // Use larger than max int to catch overflow early. 30 // Use larger than max int to catch overflow early.
31 const int64_t kSynthesizedDisplayIdStart = 2200000000LL; 31 const int64_t kSynthesizedDisplayIdStart = 2200000000LL;
32 32
33 int64_t synthesized_display_id = kSynthesizedDisplayIdStart; 33 int64_t synthesized_display_id = kSynthesizedDisplayIdStart;
34 34
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 rotation = gfx::Display::ROTATE_270; 164 rotation = gfx::Display::ROTATE_270;
165 break; 165 break;
166 } 166 }
167 } 167 }
168 } 168 }
169 } 169 }
170 170
171 float device_scale_factor = 1.0f; 171 float device_scale_factor = 1.0f;
172 if (!GetDisplayBounds(main_spec, &bounds_in_native, &device_scale_factor)) { 172 if (!GetDisplayBounds(main_spec, &bounds_in_native, &device_scale_factor)) {
173 #if defined(OS_WIN) 173 #if defined(OS_WIN)
174 device_scale_factor = gfx::GetDPIScale(); 174 device_scale_factor = display::win::GetDPIScale();
175 #endif 175 #endif
176 } 176 }
177 177
178 std::vector<DisplayMode> display_modes; 178 std::vector<DisplayMode> display_modes;
179 parts = base::SplitString(main_spec, "#", base::KEEP_WHITESPACE, 179 parts = base::SplitString(main_spec, "#", base::KEEP_WHITESPACE,
180 base::SPLIT_WANT_NONEMPTY); 180 base::SPLIT_WANT_NONEMPTY);
181 if (parts.size() == 2) { 181 if (parts.size() == 2) {
182 size_t native_mode = 0; 182 size_t native_mode = 0;
183 int largest_area = -1; 183 int largest_area = -1;
184 float highest_refresh_rate = -1.0f; 184 float highest_refresh_rate = -1.0f;
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 455
456 void DisplayInfo::ClearInputDevices() { 456 void DisplayInfo::ClearInputDevices() {
457 input_devices_.clear(); 457 input_devices_.clear();
458 } 458 }
459 459
460 void ResetDisplayIdForTest() { 460 void ResetDisplayIdForTest() {
461 synthesized_display_id = kSynthesizedDisplayIdStart; 461 synthesized_display_id = kSynthesizedDisplayIdStart;
462 } 462 }
463 463
464 } // namespace ash 464 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/app/chrome_exe_main_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698