| 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 #ifndef CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ | 5 #ifndef CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ |
| 6 #define CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ | 6 #define CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 virtual void InitXRandRExtension(int* event_base) OVERRIDE; | 32 virtual void InitXRandRExtension(int* event_base) OVERRIDE; |
| 33 virtual void UpdateXRandRConfiguration( | 33 virtual void UpdateXRandRConfiguration( |
| 34 const base::NativeEvent& event) OVERRIDE; | 34 const base::NativeEvent& event) OVERRIDE; |
| 35 virtual void GrabServer() OVERRIDE; | 35 virtual void GrabServer() OVERRIDE; |
| 36 virtual void UngrabServer() OVERRIDE; | 36 virtual void UngrabServer() OVERRIDE; |
| 37 virtual void SyncWithServer() OVERRIDE; | 37 virtual void SyncWithServer() OVERRIDE; |
| 38 virtual void SetBackgroundColor(uint32 color_argb) OVERRIDE; | 38 virtual void SetBackgroundColor(uint32 color_argb) OVERRIDE; |
| 39 virtual void ForceDPMSOn() OVERRIDE; | 39 virtual void ForceDPMSOn() OVERRIDE; |
| 40 virtual std::vector<OutputConfigurator::OutputSnapshot> GetOutputs( | 40 virtual std::vector<OutputConfigurator::OutputSnapshot> GetOutputs( |
| 41 const OutputConfigurator::StateController* state_controller) OVERRIDE; | 41 const OutputConfigurator::StateController* state_controller) OVERRIDE; |
| 42 virtual bool GetModeDetails( | |
| 43 RRMode mode, | |
| 44 int* width, | |
| 45 int* height, | |
| 46 bool* interlaced) OVERRIDE; | |
| 47 virtual bool ConfigureCrtc( | 42 virtual bool ConfigureCrtc( |
| 48 RRCrtc crtc, | 43 RRCrtc crtc, |
| 49 RRMode mode, | 44 RRMode mode, |
| 50 RROutput output, | 45 RROutput output, |
| 51 int x, | 46 int x, |
| 52 int y) OVERRIDE; | 47 int y) OVERRIDE; |
| 53 virtual void CreateFrameBuffer( | 48 virtual void CreateFrameBuffer( |
| 54 int width, | 49 int width, |
| 55 int height, | 50 int height, |
| 56 const std::vector<OutputConfigurator::OutputSnapshot>& outputs) OVERRIDE; | 51 const std::vector<OutputConfigurator::OutputSnapshot>& outputs) OVERRIDE; |
| 57 virtual void ConfigureCTM( | 52 virtual void ConfigureCTM( |
| 58 int touch_device_id, | 53 int touch_device_id, |
| 59 const OutputConfigurator::CoordinateTransformation& ctm) OVERRIDE; | 54 const OutputConfigurator::CoordinateTransformation& ctm) OVERRIDE; |
| 60 virtual void SendProjectingStateToPowerManager(bool projecting) OVERRIDE; | 55 virtual void SendProjectingStateToPowerManager(bool projecting) OVERRIDE; |
| 61 | 56 |
| 62 private: | 57 private: |
| 58 // Gets details corresponding to |mode|. Parameters may be NULL. Returns |
| 59 // true on success. |
| 60 bool GetModeDetails(RRMode mode, int* width, int* height, bool* interlaced); |
| 61 |
| 62 // Helper method for GetOutputs() that returns an OutputSnapshot struct based |
| 63 // on the passed-in information. Further initialization is required (e.g. |
| 64 // |mirror_mode| and |touch_device_id|). |
| 65 OutputConfigurator::OutputSnapshot InitOutputSnapshot( |
| 66 RROutput id, |
| 67 XRROutputInfo* info, |
| 68 RRCrtc* last_used_crtc, |
| 69 int index, |
| 70 const OutputConfigurator::StateController* state_controller); |
| 71 |
| 63 // Destroys unused CRTCs and parks used CRTCs in a way which allows a | 72 // Destroys unused CRTCs and parks used CRTCs in a way which allows a |
| 64 // framebuffer resize. This is faster than turning them off, resizing, | 73 // framebuffer resize. This is faster than turning them off, resizing, |
| 65 // then turning them back on. | 74 // then turning them back on. |
| 66 void DestroyUnusedCrtcs( | 75 void DestroyUnusedCrtcs( |
| 67 const std::vector<OutputConfigurator::OutputSnapshot>& outputs); | 76 const std::vector<OutputConfigurator::OutputSnapshot>& outputs); |
| 68 | 77 |
| 69 // Returns whether |id| is configured to preserve aspect when scaling. | 78 // Returns whether |id| is configured to preserve aspect when scaling. |
| 70 bool IsOutputAspectPreservingScaling(RROutput id); | 79 bool IsOutputAspectPreservingScaling(RROutput id); |
| 71 | 80 |
| 72 // Looks for a mode on internal and external outputs having same | 81 // Looks for a mode on internal and external outputs having same |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 114 |
| 106 // Used to enable modes which rely on panel fitting. | 115 // Used to enable modes which rely on panel fitting. |
| 107 bool is_panel_fitting_enabled_; | 116 bool is_panel_fitting_enabled_; |
| 108 | 117 |
| 109 DISALLOW_COPY_AND_ASSIGN(RealOutputConfiguratorDelegate); | 118 DISALLOW_COPY_AND_ASSIGN(RealOutputConfiguratorDelegate); |
| 110 }; | 119 }; |
| 111 | 120 |
| 112 } // namespace chromeos | 121 } // namespace chromeos |
| 113 | 122 |
| 114 #endif // CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ | 123 #endif // CHROMEOS_DISPLAY_REAL_OUTPUT_CONFIGURATOR_DELEGATE_H_ |
| OLD | NEW |