| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_OZONE_PLATFORM_DRM_HOST_DRM_DISPLAY_HOST_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_HOST_DRM_DISPLAY_HOST_H_ |
| 6 #define UI_OZONE_PLATFORM_DRM_HOST_DRM_DISPLAY_HOST_H_ | 6 #define UI_OZONE_PLATFORM_DRM_HOST_DRM_DISPLAY_HOST_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/display/types/display_constants.h" | 10 #include "ui/display/types/display_constants.h" |
| 11 #include "ui/display/types/native_display_delegate.h" | 11 #include "ui/display/types/native_display_delegate.h" |
| 12 #include "ui/ozone/platform/drm/host/gpu_thread_observer.h" | 12 #include "ui/ozone/platform/drm/host/gpu_thread_observer.h" |
| 13 | 13 |
| 14 namespace ui { | 14 namespace ui { |
| 15 | 15 |
| 16 struct DisplaySnapshot_Params; | 16 struct DisplaySnapshot_Params; |
| 17 class DisplaySnapshot; | 17 class DisplaySnapshot; |
| 18 class DrmGpuPlatformSupportHost; | 18 class GpuThreadAdapter; |
| 19 | 19 |
| 20 class DrmDisplayHost : public GpuThreadObserver { | 20 class DrmDisplayHost : public GpuThreadObserver { |
| 21 public: | 21 public: |
| 22 DrmDisplayHost(DrmGpuPlatformSupportHost* sender, | 22 DrmDisplayHost(GpuThreadAdapter* sender, |
| 23 const DisplaySnapshot_Params& params, | 23 const DisplaySnapshot_Params& params, |
| 24 bool is_dummy); | 24 bool is_dummy); |
| 25 ~DrmDisplayHost() override; | 25 ~DrmDisplayHost() override; |
| 26 | 26 |
| 27 DisplaySnapshot* snapshot() const { return snapshot_.get(); } | 27 DisplaySnapshot* snapshot() const { return snapshot_.get(); } |
| 28 | 28 |
| 29 void UpdateDisplaySnapshot(const DisplaySnapshot_Params& params); | 29 void UpdateDisplaySnapshot(const DisplaySnapshot_Params& params); |
| 30 void Configure(const DisplayMode* mode, | 30 void Configure(const DisplayMode* mode, |
| 31 const gfx::Point& origin, | 31 const gfx::Point& origin, |
| 32 const ConfigureCallback& callback); | 32 const ConfigureCallback& callback); |
| 33 void GetHDCPState(const GetHDCPStateCallback& callback); | 33 void GetHDCPState(const GetHDCPStateCallback& callback); |
| 34 void SetHDCPState(HDCPState state, const SetHDCPStateCallback& callback); | 34 void SetHDCPState(HDCPState state, const SetHDCPStateCallback& callback); |
| 35 void SetGammaRamp(const std::vector<GammaRampRGBEntry>& lut); | 35 void SetGammaRamp(const std::vector<GammaRampRGBEntry>& lut); |
| 36 | 36 |
| 37 // Called when the IPC from the GPU process arrives to answer the above | 37 // Called when the IPC from the GPU process arrives to answer the above |
| 38 // commands. | 38 // commands. |
| 39 void OnDisplayConfigured(bool status); | 39 void OnDisplayConfigured(bool status); |
| 40 void OnHDCPStateReceived(bool status, HDCPState state); | 40 void OnHDCPStateReceived(bool status, HDCPState state); |
| 41 void OnHDCPStateUpdated(bool status); | 41 void OnHDCPStateUpdated(bool status); |
| 42 | 42 |
| 43 // GpuThreadObserver: | 43 // GpuThreadObserver: |
| 44 void OnGpuThreadReady() override; | 44 void OnGpuThreadReady() override; |
| 45 void OnGpuThreadRetired() override; | 45 void OnGpuThreadRetired() override; |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 // Calls all the callbacks with failure. | 48 // Calls all the callbacks with failure. |
| 49 void ClearCallbacks(); | 49 void ClearCallbacks(); |
| 50 | 50 |
| 51 DrmGpuPlatformSupportHost* sender_; // Not owned. | 51 GpuThreadAdapter* sender_; // Not owned. |
| 52 | 52 |
| 53 scoped_ptr<DisplaySnapshot> snapshot_; | 53 scoped_ptr<DisplaySnapshot> snapshot_; |
| 54 | 54 |
| 55 // Used during startup to signify that any display configuration should be | 55 // Used during startup to signify that any display configuration should be |
| 56 // synchronous and succeed. | 56 // synchronous and succeed. |
| 57 bool is_dummy_; | 57 bool is_dummy_; |
| 58 | 58 |
| 59 ConfigureCallback configure_callback_; | 59 ConfigureCallback configure_callback_; |
| 60 GetHDCPStateCallback get_hdcp_callback_; | 60 GetHDCPStateCallback get_hdcp_callback_; |
| 61 SetHDCPStateCallback set_hdcp_callback_; | 61 SetHDCPStateCallback set_hdcp_callback_; |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(DrmDisplayHost); | 63 DISALLOW_COPY_AND_ASSIGN(DrmDisplayHost); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace ui | 66 } // namespace ui |
| 67 | 67 |
| 68 #endif // UI_OZONE_PLATFORM_DRM_HOST_DRM_DISPLAY_HOST_H_ | 68 #endif // UI_OZONE_PLATFORM_DRM_HOST_DRM_DISPLAY_HOST_H_ |
| OLD | NEW |