OLD | NEW |
1 // Copyright 2016 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_MUS_THREAD_PROXY_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_MUS_THREAD_PROXY_H_ |
6 #define UI_OZONE_PLATFORM_DRM_MUS_THREAD_PROXY_H_ | 6 #define UI_OZONE_PLATFORM_DRM_MUS_THREAD_PROXY_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
13 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
14 #include "ui/ozone/platform/drm/gpu/inter_thread_messaging_proxy.h" | 14 #include "ui/ozone/platform/drm/gpu/inter_thread_messaging_proxy.h" |
15 #include "ui/ozone/platform/drm/host/drm_cursor.h" | 15 #include "ui/ozone/platform/drm/host/drm_cursor.h" |
16 #include "ui/ozone/platform/drm/host/gpu_thread_adapter.h" | 16 #include "ui/ozone/platform/drm/host/gpu_thread_adapter.h" |
| 17 #include "ui/ozone/public/interfaces/device_cursor.mojom.h" |
17 | 18 |
18 namespace base { | 19 namespace base { |
19 class SingleThreadTaskRunner; | 20 class SingleThreadTaskRunner; |
20 } | 21 } |
21 | 22 |
22 namespace ui { | 23 namespace ui { |
23 | 24 |
24 class DrmCursor; | 25 class DrmCursor; |
25 class DrmDisplayHostManager; | 26 class DrmDisplayHostManager; |
26 class DrmOverlayManager; | 27 class DrmOverlayManager; |
27 class DrmThread; | 28 class DrmThread; |
28 class GpuThreadObserver; | 29 class GpuThreadObserver; |
| 30 class MusThreadProxy; |
| 31 |
| 32 // Forwarding proxy to handle ownership semantics. |
| 33 class CursorProxyThread : public DrmCursorProxy { |
| 34 public: |
| 35 explicit CursorProxyThread(MusThreadProxy* mus_thread_proxy); |
| 36 ~CursorProxyThread() override; |
| 37 |
| 38 private: |
| 39 // DrmCursorProxy. |
| 40 void CursorSet(gfx::AcceleratedWidget window, |
| 41 const std::vector<SkBitmap>& bitmaps, |
| 42 const gfx::Point& point, |
| 43 int frame_delay_ms) override; |
| 44 void Move(gfx::AcceleratedWidget window, const gfx::Point& point) override; |
| 45 void InitializeOnEvdev() override; |
| 46 MusThreadProxy* const mus_thread_proxy_; // Not owned. |
| 47 }; |
29 | 48 |
30 // In Mus, the window server thread (analogous to Chrome's UI thread), GPU and | 49 // In Mus, the window server thread (analogous to Chrome's UI thread), GPU and |
31 // DRM threads coexist in a single Mus process. The |MusThreadProxy| connects | 50 // DRM threads coexist in a single Mus process. The |MusThreadProxy| connects |
32 // these threads together via cross-thread calls. | 51 // these threads together via cross-thread calls. |
33 class MusThreadProxy : public GpuThreadAdapter, | 52 class MusThreadProxy : public GpuThreadAdapter, |
34 public InterThreadMessagingProxy, | 53 public InterThreadMessagingProxy, |
35 public DrmCursorProxy { | 54 public DrmCursorProxy { |
36 public: | 55 public: |
37 MusThreadProxy(); | 56 MusThreadProxy(); |
38 ~MusThreadProxy() override; | 57 ~MusThreadProxy() override; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 base::ThreadChecker on_window_server_thread_; | 152 base::ThreadChecker on_window_server_thread_; |
134 | 153 |
135 base::WeakPtrFactory<MusThreadProxy> weak_ptr_factory_; | 154 base::WeakPtrFactory<MusThreadProxy> weak_ptr_factory_; |
136 | 155 |
137 DISALLOW_COPY_AND_ASSIGN(MusThreadProxy); | 156 DISALLOW_COPY_AND_ASSIGN(MusThreadProxy); |
138 }; | 157 }; |
139 | 158 |
140 } // namespace ui | 159 } // namespace ui |
141 | 160 |
142 #endif // UI_OZONE_PLATFORM_DRM_MUS_THREAD_PROXY_H_ | 161 #endif // UI_OZONE_PLATFORM_DRM_MUS_THREAD_PROXY_H_ |
OLD | NEW |