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

Unified Diff: chromeos/display/output_configurator.h

Issue 22871010: chromeos: Include mode details in OutputSnapshot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add out-of-line dtor for OutputSnapshot 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/display/output_configurator.h
diff --git a/chromeos/display/output_configurator.h b/chromeos/display/output_configurator.h
index b9d7faf6bd2ec6a6c597c82c2b9e577510a06e13..6e25b4d953eb2c6912541ce5f58b219957c1a7ca 100644
--- a/chromeos/display/output_configurator.h
+++ b/chromeos/display/output_configurator.h
@@ -42,6 +42,14 @@ class CHROMEOS_EXPORT OutputConfigurator
: public base::MessageLoop::Dispatcher,
public base::MessagePumpObserver {
public:
+ struct ModeInfo {
+ ModeInfo();
+
+ int width;
+ int height;
+ bool interlaced;
oshima 2013/08/15 19:03:24 just FYI: i'm going to add preferred flag to this.
+ };
+
struct CoordinateTransformation {
// Initialized to the identity transformation.
CoordinateTransformation();
@@ -55,6 +63,7 @@ class CHROMEOS_EXPORT OutputConfigurator
// Information about an output's current state.
struct OutputSnapshot {
OutputSnapshot();
+ ~OutputSnapshot();
RROutput output;
@@ -78,9 +87,16 @@ class CHROMEOS_EXPORT OutputConfigurator
int x;
int y;
+ // Output's physical dimensions.
+ uint64 width_mm;
+ uint64 height_mm;
oshima 2013/08/15 19:03:24 are we using uint64 because that's what X is using
Daniel Erat 2013/08/15 19:26:23 Xrandr.h and ash::internal::ShouldIgnoreSize() loo
+
bool is_internal;
bool is_aspect_preserving_scaling;
+ // Map from mode IDs to details about the corresponding modes.
+ std::map<RRMode, ModeInfo> mode_infos;
+
// XInput device ID or 0 if this output isn't a touchscreen.
int touch_device_id;
@@ -96,12 +112,15 @@ class CHROMEOS_EXPORT OutputConfigurator
public:
virtual ~Observer() {}
- // Called when the change of the display mode finished. It will usually
- // start the fading in the displays.
- virtual void OnDisplayModeChanged() {}
+ // Called after the display mode has been changed. |output| contains the
+ // just-applied configuration. Note that the X server is no longer grabbed
+ // when this method is called, so the actual configuration could've changed
+ // already.
+ virtual void OnDisplayModeChanged(
+ const std::vector<OutputSnapshot>& outputs) {}
- // Called when the change of the display mode is issued but failed.
- // |failed_new_state| is the new state which the system failed to enter.
+ // Called after a display mode change attempt failed. |failed_new_state| is
+ // the new state which the system failed to enter.
virtual void OnDisplayModeChangeFailed(OutputState failed_new_state) {}
};
@@ -168,13 +187,6 @@ class CHROMEOS_EXPORT OutputConfigurator
virtual std::vector<OutputSnapshot> GetOutputs(
const StateController* state_controller) = 0;
- // Gets details corresponding to |mode|. Parameters may be NULL.
- // Returns true on success.
- virtual bool GetModeDetails(RRMode mode,
- int* width,
- int* height,
- bool* interlaced) = 0;
-
// Calls XRRSetCrtcConfig() with the given options but some of our default
// output count and rotation arguments. Returns true on success.
virtual bool ConfigureCrtc(RRCrtc crtc,
@@ -249,6 +261,11 @@ class CHROMEOS_EXPORT OutputConfigurator
// See crbug.com/130188 for initial discussion.
static const int kVerticalGap = 60;
+ // Returns a pointer to the ModeInfo struct in |output| corresponding to
+ // |mode|, or NULL if the struct isn't present.
+ static const ModeInfo* GetModeInfo(const OutputSnapshot& output,
+ RRMode mode);
+
OutputConfigurator();
virtual ~OutputConfigurator();
@@ -360,12 +377,12 @@ class CHROMEOS_EXPORT OutputConfigurator
// |output| is the output on which mirror mode is being applied.
// Returns the transformation or identity if computations fail.
CoordinateTransformation GetMirrorModeCTM(
- const OutputConfigurator::OutputSnapshot* output);
+ const OutputConfigurator::OutputSnapshot& output);
// Returns the ratio between mirrored mode area and native mode area:
// (mirror_mode_width * mirrow_mode_height) / (native_width * native_height)
float GetMirroredDisplayAreaRatio(
- const OutputConfigurator::OutputSnapshot* output);
+ const OutputConfigurator::OutputSnapshot& output);
StateController* state_controller_;
SoftwareMirroringController* mirroring_controller_;

Powered by Google App Engine
This is Rietveld 408576698