Chromium Code Reviews| Index: chromeos/display/output_configurator.h |
| diff --git a/chromeos/display/output_configurator.h b/chromeos/display/output_configurator.h |
| index ca03bfd1bf4462d01772bab949adc06fb6aef7ad..01e1ab6cdc6823dc5c7ddf8dfb98c7b91c667514 100644 |
| --- a/chromeos/display/output_configurator.h |
| +++ b/chromeos/display/output_configurator.h |
| @@ -20,11 +20,18 @@ typedef XID RROutput; |
| typedef XID RRCrtc; |
| typedef XID RRMode; |
| +struct _XDisplay; |
| +typedef struct _XDisplay Display; |
| +struct _XRROutputInfo; |
| +typedef _XRROutputInfo XRROutputInfo; |
| struct _XRRScreenResources; |
| typedef _XRRScreenResources XRRScreenResources; |
| namespace chromeos { |
| +struct OutputSnapshot; |
| +typedef struct OutputSnapshot OutputSnapshot; |
|
oshima
2012/09/21 19:38:12
you don't need this
ynovikov
2012/09/21 23:05:36
Done.
|
| + |
| // Used to describe the state of a multi-display configuration. |
| // TODO(oshima): remove DUAL_SECONDARY_ONLY |
| enum OutputState { |
| @@ -57,6 +64,10 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher { |
| OutputState output_state() const { return output_state_; } |
| + // Initialization, must be called right after constructor. |
| + // |is_panel_fitting_enabled| indicates hardware panel fitting support. |
| + void Init(bool is_panel_fitting_enabled); |
| + |
| // Called when the user hits ctrl-F4 to request a display mode change. |
| // This method should only return false if it was called in a single-head or |
| // headless mode. |
| @@ -89,6 +100,37 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher { |
| // Fires OnDisplayModeChanged() event to the observers. |
| void NotifyOnDisplayChanged(); |
| + // Returns output's native mode, None if not found. |
| + static RRMode GetOutputNativeMode(const XRROutputInfo* output_info); |
| + |
| + // Tells if the output specified by |output_info| is for internal display. |
| + static bool IsInternalOutput(const XRROutputInfo* output_info); |
|
oshima
2012/09/21 19:38:12
move static after private instance methods
also pl
ynovikov
2012/09/21 23:05:36
Done.
|
| + |
| + // Fills output parameters |one| and |two| with properties of |
| + // first two connected outputs found on |display| and |screen|. |
| + int GetDualOutputs(Display* display, |
| + XRRScreenResources* screen, |
| + OutputSnapshot* one, |
| + OutputSnapshot* two); |
|
oshima
2012/09/21 19:38:12
move static methods before (or after) private inst
ynovikov
2012/09/21 23:05:36
Done.
|
| + |
| + // Should be called if the internal (built-in) output didn't advertise a mode |
| + // which would be capable to support mirror mode. |
| + // Relies on hardware panel fitting support, |
| + // returns immediately if it is not available. |
| + // Tries to add the native mode of the external output to the internal output, |
| + // assuming panel fitter hardware will take care of scaling and letterboxing. |
| + // The RROutput IDs |output_one| and |output_two| are used |
| + // to look up the modes and configure the internal output, |
| + // |output_one_mode| and |output_two_mode| are the out-parameters |
| + // for the modes on the two outputs which will have same resolution. |
| + // Returns false if it fails to configure the internal output appropriately. |
| + bool AddMirrorModeToInternalOutput(Display* display, |
| + XRRScreenResources* screen, |
| + RROutput output_one, |
| + RROutput output_two, |
| + RRMode* output_one_mode, |
| + RRMode* output_two_mode); |
| + |
| // This is detected by the constructor to determine whether or not we should |
| // be enabled. If we aren't running on ChromeOS, we can't assume that the |
| // Xrandr X11 extension is supported. |
| @@ -96,6 +138,10 @@ class CHROMEOS_EXPORT OutputConfigurator : public MessageLoop::Dispatcher { |
| // configuration to immediately fail without changing the state. |
| bool is_running_on_chrome_os_; |
| + // This is set externally in Init, |
| + // and is used to enable modes which rely on panel fitting. |
| + bool is_panel_fitting_enabled_; |
| + |
| // The number of outputs that are connected. |
| int connected_output_count_; |