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

Side by Side Diff: chromeos/display/output_configurator.h

Issue 23286003: ash: Get output info from chromeos instead of XRandR. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use index from XRandR Created 7 years, 4 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 | « ash/shell.cc ('k') | chromeos/display/output_configurator.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ 5 #ifndef CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_
6 #define CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ 6 #define CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 26 matching lines...) Expand all
37 }; 37 };
38 38
39 // This class interacts directly with the underlying Xrandr API to manipulate 39 // This class interacts directly with the underlying Xrandr API to manipulate
40 // CTRCs and Outputs. 40 // CTRCs and Outputs.
41 class CHROMEOS_EXPORT OutputConfigurator 41 class CHROMEOS_EXPORT OutputConfigurator
42 : public base::MessageLoop::Dispatcher, 42 : public base::MessageLoop::Dispatcher,
43 public base::MessagePumpObserver { 43 public base::MessagePumpObserver {
44 public: 44 public:
45 struct ModeInfo { 45 struct ModeInfo {
46 ModeInfo(); 46 ModeInfo();
47 ModeInfo(int width, int height, bool interlaced);
47 48
48 int width; 49 int width;
49 int height; 50 int height;
50 bool interlaced; 51 bool interlaced;
51 }; 52 };
52 53
53 struct CoordinateTransformation { 54 struct CoordinateTransformation {
54 // Initialized to the identity transformation. 55 // Initialized to the identity transformation.
55 CoordinateTransformation(); 56 CoordinateTransformation();
56 57
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 100
100 // XInput device ID or 0 if this output isn't a touchscreen. 101 // XInput device ID or 0 if this output isn't a touchscreen.
101 int touch_device_id; 102 int touch_device_id;
102 103
103 CoordinateTransformation transform; 104 CoordinateTransformation transform;
104 105
105 // Display id for this output. 106 // Display id for this output.
106 int64 display_id; 107 int64 display_id;
107 108
108 bool has_display_id; 109 bool has_display_id;
110
111 // This output's index in the array returned by XRandR. Stable even as
112 // outputs are connected or disconnected.
113 int index;
109 }; 114 };
110 115
111 class Observer { 116 class Observer {
112 public: 117 public:
113 virtual ~Observer() {} 118 virtual ~Observer() {}
114 119
115 // Called after the display mode has been changed. |output| contains the 120 // Called after the display mode has been changed. |output| contains the
116 // just-applied configuration. Note that the X server is no longer grabbed 121 // just-applied configuration. Note that the X server is no longer grabbed
117 // when this method is called, so the actual configuration could've changed 122 // when this method is called, so the actual configuration could've changed
118 // already. 123 // already.
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 scoped_ptr<base::OneShotTimer<OutputConfigurator> > configure_timer_; 429 scoped_ptr<base::OneShotTimer<OutputConfigurator> > configure_timer_;
425 430
426 DISALLOW_COPY_AND_ASSIGN(OutputConfigurator); 431 DISALLOW_COPY_AND_ASSIGN(OutputConfigurator);
427 }; 432 };
428 433
429 typedef std::vector<OutputConfigurator::OutputSnapshot> OutputSnapshotList; 434 typedef std::vector<OutputConfigurator::OutputSnapshot> OutputSnapshotList;
430 435
431 } // namespace chromeos 436 } // namespace chromeos
432 437
433 #endif // CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_ 438 #endif // CHROMEOS_DISPLAY_OUTPUT_CONFIGURATOR_H_
OLDNEW
« no previous file with comments | « ash/shell.cc ('k') | chromeos/display/output_configurator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698