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 "chromeos/display/real_output_configurator_delegate.h" | 5 #include "chromeos/display/real_output_configurator_delegate.h" |
6 | 6 |
7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 #include <X11/extensions/dpms.h> | 9 #include <X11/extensions/dpms.h> |
10 #include <X11/extensions/XInput.h> | 10 #include <X11/extensions/XInput.h> |
11 #include <X11/extensions/XInput2.h> | 11 #include <X11/extensions/XInput2.h> |
12 #include <X11/extensions/Xrandr.h> | 12 #include <X11/extensions/Xrandr.h> |
13 | 13 |
14 #include <cmath> | 14 #include <cmath> |
15 #include <set> | 15 #include <set> |
16 #include <utility> | 16 #include <utility> |
17 | 17 |
18 #include "base/logging.h" | 18 #include "base/logging.h" |
19 #include "base/message_loop/message_pump_x11.h" | 19 #include "base/message_loop/message_pump_x11.h" |
20 #include "base/x11/edid_parser_x11.h" | |
21 #include "chromeos/dbus/dbus_thread_manager.h" | 20 #include "chromeos/dbus/dbus_thread_manager.h" |
22 #include "chromeos/dbus/power_manager_client.h" | 21 #include "chromeos/dbus/power_manager_client.h" |
23 #include "chromeos/display/output_util.h" | 22 #include "chromeos/display/output_util.h" |
24 | 23 |
25 namespace chromeos { | 24 namespace chromeos { |
26 | 25 |
27 namespace { | 26 namespace { |
28 | 27 |
29 // DPI measurements. | 28 // DPI measurements. |
30 const float kMmInInch = 25.4; | 29 const float kMmInInch = 25.4; |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 OutputConfigurator::OutputSnapshot | 256 OutputConfigurator::OutputSnapshot |
258 RealOutputConfiguratorDelegate::InitOutputSnapshot( | 257 RealOutputConfiguratorDelegate::InitOutputSnapshot( |
259 RROutput id, | 258 RROutput id, |
260 XRROutputInfo* info, | 259 XRROutputInfo* info, |
261 RRCrtc* last_used_crtc, | 260 RRCrtc* last_used_crtc, |
262 int index) { | 261 int index) { |
263 OutputConfigurator::OutputSnapshot output; | 262 OutputConfigurator::OutputSnapshot output; |
264 output.output = id; | 263 output.output = id; |
265 output.width_mm = info->mm_width; | 264 output.width_mm = info->mm_width; |
266 output.height_mm = info->mm_height; | 265 output.height_mm = info->mm_height; |
267 output.has_display_id = base::GetDisplayId(id, index, &output.display_id); | 266 output.has_display_id = GetDisplayId(id, index, &output.display_id); |
268 output.is_internal = IsInternalOutput(info); | 267 output.is_internal = IsInternalOutput(info); |
269 output.index = index; | 268 output.index = index; |
270 | 269 |
271 // Use the index as a valid display ID even if the internal | 270 // Use the index as a valid display ID even if the internal |
272 // display doesn't have valid EDID because the index | 271 // display doesn't have valid EDID because the index |
273 // will never change. | 272 // will never change. |
274 if (!output.has_display_id && output.is_internal) | 273 if (!output.has_display_id && output.is_internal) |
275 output.has_display_id = true; | 274 output.has_display_id = true; |
276 | 275 |
277 if (info->crtc) { | 276 if (info->crtc) { |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 << (*outputs)[i].touch_device_id << " to output #" << i; | 500 << (*outputs)[i].touch_device_id << " to output #" << i; |
502 break; | 501 break; |
503 } | 502 } |
504 } | 503 } |
505 } | 504 } |
506 | 505 |
507 XIFreeDeviceInfo(info); | 506 XIFreeDeviceInfo(info); |
508 } | 507 } |
509 | 508 |
510 } // namespace chromeos | 509 } // namespace chromeos |
OLD | NEW |