| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_DISPLAY_TYPES_NATIVE_DISPLAY_DELEGATE_H_ | 5 #ifndef UI_DISPLAY_TYPES_NATIVE_DISPLAY_DELEGATE_H_ |
| 6 #define UI_DISPLAY_TYPES_NATIVE_DISPLAY_DELEGATE_H_ | 6 #define UI_DISPLAY_TYPES_NATIVE_DISPLAY_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "ui/display/types/display_constants.h" | 13 #include "ui/display/types/display_constants.h" |
| 14 #include "ui/display/types/display_types_export.h" | 14 #include "ui/display/types/display_types_export.h" |
| 15 #include "ui/display/types/fake_display_controller.h" |
| 15 | 16 |
| 16 namespace gfx { | 17 namespace gfx { |
| 17 class Point; | 18 class Point; |
| 18 class Size; | 19 class Size; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace ui { | 22 namespace ui { |
| 22 class DisplayMode; | 23 class DisplayMode; |
| 23 class DisplaySnapshot; | 24 class DisplaySnapshot; |
| 24 | |
| 25 class NativeDisplayObserver; | 25 class NativeDisplayObserver; |
| 26 | 26 |
| 27 struct GammaRampRGBEntry; | 27 struct GammaRampRGBEntry; |
| 28 | 28 |
| 29 typedef base::Callback<void(const std::vector<ui::DisplaySnapshot*>&)> | 29 using GetDisplaysCallback = |
| 30 GetDisplaysCallback; | 30 base::Callback<void(const std::vector<ui::DisplaySnapshot*>&)>; |
| 31 typedef base::Callback<void(bool)> ConfigureCallback; | 31 using ConfigureCallback = base::Callback<void(bool)>; |
| 32 typedef base::Callback<void(bool, ui::HDCPState)> GetHDCPStateCallback; | 32 using GetHDCPStateCallback = base::Callback<void(bool, ui::HDCPState)>; |
| 33 typedef base::Callback<void(bool)> SetHDCPStateCallback; | 33 using SetHDCPStateCallback = base::Callback<void(bool)>; |
| 34 typedef base::Callback<void(bool)> DisplayControlCallback; | 34 using DisplayControlCallback = base::Callback<void(bool)>; |
| 35 | 35 |
| 36 // Interface for classes that perform display configuration actions on behalf | 36 // Interface for classes that perform display configuration actions on behalf |
| 37 // of DisplayConfigurator. | 37 // of DisplayConfigurator. |
| 38 // Implementations may perform calls asynchronously. In the case of functions | 38 // Implementations may perform calls asynchronously. In the case of functions |
| 39 // taking callbacks, the callbacks may be called asynchronously when the results | 39 // taking callbacks, the callbacks may be called asynchronously when the results |
| 40 // are available. The implementations must provide a strong guarantee that the | 40 // are available. The implementations must provide a strong guarantee that the |
| 41 // callbacks are always called. | 41 // callbacks are always called. |
| 42 class DISPLAY_TYPES_EXPORT NativeDisplayDelegate { | 42 class DISPLAY_TYPES_EXPORT NativeDisplayDelegate { |
| 43 public: | 43 public: |
| 44 virtual ~NativeDisplayDelegate() {} | 44 virtual ~NativeDisplayDelegate(); |
| 45 | 45 |
| 46 virtual void Initialize() = 0; | 46 virtual void Initialize() = 0; |
| 47 | 47 |
| 48 // Grabs and refreshes any display server related resources. Must be balanced | 48 // Grabs and refreshes any display server related resources. Must be balanced |
| 49 // by a call to UngrabServer(). | 49 // by a call to UngrabServer(). |
| 50 virtual void GrabServer() = 0; | 50 virtual void GrabServer() = 0; |
| 51 | 51 |
| 52 // Released the display server and any resources allocated by GrabServer(). | 52 // Released the display server and any resources allocated by GrabServer(). |
| 53 virtual void UngrabServer() = 0; | 53 virtual void UngrabServer() = 0; |
| 54 | 54 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // Set the gamma tables and corection matrix for the display. | 110 // Set the gamma tables and corection matrix for the display. |
| 111 virtual bool SetColorCorrection( | 111 virtual bool SetColorCorrection( |
| 112 const ui::DisplaySnapshot& output, | 112 const ui::DisplaySnapshot& output, |
| 113 const std::vector<GammaRampRGBEntry>& degamma_lut, | 113 const std::vector<GammaRampRGBEntry>& degamma_lut, |
| 114 const std::vector<GammaRampRGBEntry>& gamma_lut, | 114 const std::vector<GammaRampRGBEntry>& gamma_lut, |
| 115 const std::vector<float>& correction_matrix) = 0; | 115 const std::vector<float>& correction_matrix) = 0; |
| 116 | 116 |
| 117 virtual void AddObserver(NativeDisplayObserver* observer) = 0; | 117 virtual void AddObserver(NativeDisplayObserver* observer) = 0; |
| 118 | 118 |
| 119 virtual void RemoveObserver(NativeDisplayObserver* observer) = 0; | 119 virtual void RemoveObserver(NativeDisplayObserver* observer) = 0; |
| 120 |
| 121 // Returns a fake display controller that can modify the fake display state. |
| 122 // Will return null if not needed, most likely because the delegate is |
| 123 // intended for use on device and doesn't need to fake the display state. |
| 124 virtual display::FakeDisplayController* GetFakeDisplayController() = 0; |
| 120 }; | 125 }; |
| 121 | 126 |
| 122 } // namespace ui | 127 } // namespace ui |
| 123 | 128 |
| 124 #endif // UI_DISPLAY_TYPES_NATIVE_DISPLAY_DELEGATE_H_ | 129 #endif // UI_DISPLAY_TYPES_NATIVE_DISPLAY_DELEGATE_H_ |
| OLD | NEW |