OLD | NEW |
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 <stdio.h> | 5 #include <stdio.h> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/display/display_info.h" | 9 #include "ash/display/display_info.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 int x = 0, y = 0, width, height; | 108 int x = 0, y = 0, width, height; |
109 float device_scale_factor = 1.0f; | 109 float device_scale_factor = 1.0f; |
110 if (sscanf(main_spec.c_str(), "%dx%d*%f", | 110 if (sscanf(main_spec.c_str(), "%dx%d*%f", |
111 &width, &height, &device_scale_factor) >= 2 || | 111 &width, &height, &device_scale_factor) >= 2 || |
112 sscanf(main_spec.c_str(), "%d+%d-%dx%d*%f", &x, &y, &width, &height, | 112 sscanf(main_spec.c_str(), "%d+%d-%dx%d*%f", &x, &y, &width, &height, |
113 &device_scale_factor) >= 4) { | 113 &device_scale_factor) >= 4) { |
114 bounds_in_native.SetRect(x, y, width, height); | 114 bounds_in_native.SetRect(x, y, width, height); |
115 } else { | 115 } else { |
116 #if defined(OS_WIN) | 116 #if defined(OS_WIN) |
117 if (gfx::IsHighDPIEnabled()) { | 117 if (gfx::IsHighDPIEnabled()) { |
118 device_scale_factor = gfx::GetModernUIScale(); | 118 device_scale_factor = gfx::GetDPIScale(); |
119 } | 119 } |
120 #endif | 120 #endif |
121 } | 121 } |
122 | 122 |
123 std::vector<DisplayMode> display_modes; | 123 std::vector<DisplayMode> display_modes; |
124 if (Tokenize(main_spec, "#", &parts) == 2) { | 124 if (Tokenize(main_spec, "#", &parts) == 2) { |
125 size_t native_mode = 0; | 125 size_t native_mode = 0; |
126 int largest_area = -1; | 126 int largest_area = -1; |
127 float highest_refresh_rate = -1.0f; | 127 float highest_refresh_rate = -1.0f; |
128 main_spec = parts[0]; | 128 main_spec = parts[0]; |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 } | 333 } |
334 | 334 |
335 bool DisplayInfo::IsColorProfileAvailable( | 335 bool DisplayInfo::IsColorProfileAvailable( |
336 ui::ColorCalibrationProfile profile) const { | 336 ui::ColorCalibrationProfile profile) const { |
337 return std::find(available_color_profiles_.begin(), | 337 return std::find(available_color_profiles_.begin(), |
338 available_color_profiles_.end(), | 338 available_color_profiles_.end(), |
339 profile) != available_color_profiles_.end(); | 339 profile) != available_color_profiles_.end(); |
340 } | 340 } |
341 | 341 |
342 } // namespace ash | 342 } // namespace ash |
OLD | NEW |