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