Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: ui/ozone/platform/drm/host/drm_overlay_manager.h

Issue 1661783002: Centralize all gbm ozone host IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_OVERLAY_MANAGER_H_ 5 #ifndef UI_OZONE_PLATFORM_DRM_HOST_DRM_OVERLAY_MANAGER_H_
6 #define UI_OZONE_PLATFORM_DRM_HOST_DRM_OVERLAY_MANAGER_H_ 6 #define UI_OZONE_PLATFORM_DRM_HOST_DRM_OVERLAY_MANAGER_H_
7 7
8 #include <stdint.h>
9
10 #include <vector>
11
12 #include "base/containers/mru_cache.h"
8 #include "base/macros.h" 13 #include "base/macros.h"
9 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h" 14 #include "base/memory/scoped_vector.h"
10 #include "ui/ozone/platform/drm/host/drm_overlay_manager_core.h" 15 #include "ui/ozone/platform/drm/host/gpu_thread_adapter.h"
11 #include "ui/ozone/public/gpu_platform_support_host.h" 16 #include "ui/ozone/public/overlay_candidates_ozone.h"
12 #include "ui/ozone/public/overlay_manager_ozone.h" 17 #include "ui/ozone/public/overlay_manager_ozone.h"
13 18
14 namespace ui { 19 namespace ui {
20 class DrmWindowHostManager;
15 21
16 class DrmWindowHostManager; 22 class DrmOverlayManager : public OverlayManagerOzone {
17 class DrmGpuPlatformSupportHost;
18
19 class DrmOverlayManager : public OverlayManagerOzone,
20 public GpuPlatformSupportHost {
21 public: 23 public:
22 DrmOverlayManager(DrmGpuPlatformSupportHost* platform_support_host, 24 DrmOverlayManager(GpuThreadAdapter* proxy,
23 DrmWindowHostManager* window_manager); 25 DrmWindowHostManager* window_manager);
24 ~DrmOverlayManager() override; 26 ~DrmOverlayManager() override;
25 27
26 // OverlayManagerOzone: 28 // OverlayManagerOzone:
27 scoped_ptr<OverlayCandidatesOzone> CreateOverlayCandidates( 29 scoped_ptr<OverlayCandidatesOzone> CreateOverlayCandidates(
28 gfx::AcceleratedWidget w) override; 30 gfx::AcceleratedWidget w) override;
29 31
30 // GpuPlatformSupportHost:
31 void OnChannelEstablished(
32 int host_id,
33 scoped_refptr<base::SingleThreadTaskRunner> send_runner,
34 const base::Callback<void(IPC::Message*)>& sender) override;
35 void OnChannelDestroyed(int host_id) override;
36 bool OnMessageReceived(const IPC::Message& message) override;
37
38 void ResetCache(); 32 void ResetCache();
39 33
34 // Communication-free implementations of actions performed in response to
35 // messages from the GPU thread.
36 void GpuSentOverlayResult(gfx::AcceleratedWidget widget,
37 const std::vector<OverlayCheck_Params>& params);
38
39 // Service method for DrmOverlayCandidatesHost
40 void CheckOverlaySupport(
41 OverlayCandidatesOzone::OverlaySurfaceCandidateList* candidates,
42 gfx::AcceleratedWidget widget);
43
40 private: 44 private:
41 // IPC handler. 45 void SendOverlayValidationRequest(
42 class OverlayCandidatesIPC : public DrmOverlayManagerProxy { 46 const std::vector<OverlayCheck_Params>& new_params,
43 public: 47 gfx::AcceleratedWidget widget) const;
44 OverlayCandidatesIPC(DrmGpuPlatformSupportHost* platform_support, 48 bool CanHandleCandidate(
45 DrmOverlayManager* parent); 49 const OverlayCandidatesOzone::OverlaySurfaceCandidate& candidate,
46 ~OverlayCandidatesIPC() override; 50 gfx::AcceleratedWidget widget) const;
47 void RegisterHandler() override;
48 bool IsConnected() override;
49 void UnregisterHandler() override;
50 bool CheckOverlayCapabilities(
51 gfx::AcceleratedWidget widget,
52 const std::vector<OverlayCheck_Params>& new_params) override;
53 51
54 private: 52 bool is_supported_;
55 DrmGpuPlatformSupportHost* platform_support_; 53 GpuThreadAdapter* proxy_; // Not owned.
56 DrmOverlayManager* parent_; 54 DrmWindowHostManager* window_manager_; // Not owned.
57 DISALLOW_COPY_AND_ASSIGN(OverlayCandidatesIPC);
58 };
59 55
60 // Entry point for incoming IPC. 56 // List of all OverlayCheck_Params which have been validated in GPU side.
61 void OnOverlayResult(gfx::AcceleratedWidget widget, 57 // Value is set to true if we are waiting for validation results from GPU.
62 const std::vector<OverlayCheck_Params>& params); 58 base::MRUCacheBase<std::vector<OverlayCheck_Params>,
63 59 bool,
64 scoped_ptr<OverlayCandidatesIPC> sender_; 60 base::MRUCacheNullDeletor<bool>>
65 scoped_ptr<DrmOverlayManagerCore> core_; 61 cache_;
66 62
67 DISALLOW_COPY_AND_ASSIGN(DrmOverlayManager); 63 DISALLOW_COPY_AND_ASSIGN(DrmOverlayManager);
68 }; 64 };
69 65
70 } // namespace ui 66 } // namespace ui
71 67
72 #endif // UI_OZONE_PLATFORM_DRM_HOST_DRM_OVERLAY_MANAGER_H_ 68 #endif // UI_OZONE_PLATFORM_DRM_HOST_DRM_OVERLAY_MANAGER_H_
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/host/drm_overlay_candidates_host.cc ('k') | ui/ozone/platform/drm/host/drm_overlay_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698