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

Side by Side Diff: chromeos/display/real_output_configurator_delegate.cc

Issue 24459002: Reland linux_aura: Implement most of DesktopScreenX11. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Theoretical fix for chromeos Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « chromeos/display/output_util_unittest.cc ('k') | ui/views/views.gyp » ('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 "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"
20 #include "chromeos/dbus/dbus_thread_manager.h" 21 #include "chromeos/dbus/dbus_thread_manager.h"
21 #include "chromeos/dbus/power_manager_client.h" 22 #include "chromeos/dbus/power_manager_client.h"
22 #include "chromeos/display/output_util.h" 23 #include "chromeos/display/output_util.h"
23 24
24 namespace chromeos { 25 namespace chromeos {
25 26
26 namespace { 27 namespace {
27 28
28 // DPI measurements. 29 // DPI measurements.
29 const float kMmInInch = 25.4; 30 const float kMmInInch = 25.4;
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 OutputConfigurator::OutputSnapshot 257 OutputConfigurator::OutputSnapshot
257 RealOutputConfiguratorDelegate::InitOutputSnapshot( 258 RealOutputConfiguratorDelegate::InitOutputSnapshot(
258 RROutput id, 259 RROutput id,
259 XRROutputInfo* info, 260 XRROutputInfo* info,
260 RRCrtc* last_used_crtc, 261 RRCrtc* last_used_crtc,
261 int index) { 262 int index) {
262 OutputConfigurator::OutputSnapshot output; 263 OutputConfigurator::OutputSnapshot output;
263 output.output = id; 264 output.output = id;
264 output.width_mm = info->mm_width; 265 output.width_mm = info->mm_width;
265 output.height_mm = info->mm_height; 266 output.height_mm = info->mm_height;
266 output.has_display_id = GetDisplayId(id, index, &output.display_id); 267 output.has_display_id = base::GetDisplayId(id, index, &output.display_id);
267 output.is_internal = IsInternalOutput(info); 268 output.is_internal = IsInternalOutput(info);
268 output.index = index; 269 output.index = index;
269 270
270 // Use the index as a valid display ID even if the internal 271 // Use the index as a valid display ID even if the internal
271 // display doesn't have valid EDID because the index 272 // display doesn't have valid EDID because the index
272 // will never change. 273 // will never change.
273 if (!output.has_display_id && output.is_internal) 274 if (!output.has_display_id && output.is_internal)
274 output.has_display_id = true; 275 output.has_display_id = true;
275 276
276 if (info->crtc) { 277 if (info->crtc) {
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 << (*outputs)[i].touch_device_id << " to output #" << i; 501 << (*outputs)[i].touch_device_id << " to output #" << i;
501 break; 502 break;
502 } 503 }
503 } 504 }
504 } 505 }
505 506
506 XIFreeDeviceInfo(info); 507 XIFreeDeviceInfo(info);
507 } 508 }
508 509
509 } // namespace chromeos 510 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/display/output_util_unittest.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698