| 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 |
| 45 void Move(gfx::AcceleratedWidget window, const gfx::Point& point) override; |
| 46 void MoveEvdev(gfx::AcceleratedWidget window, |
| 47 const gfx::Point& point) override; |
| 48 void InitializeOnEvdev() override; |
| 49 MusThreadProxy* const mus_thread_proxy_; // Not owned. |
| 50 }; |
| 29 | 51 |
| 30 // In Mus, the window server thread (analogous to Chrome's UI thread), GPU and | 52 // 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 | 53 // DRM threads coexist in a single Mus process. The |MusThreadProxy| connects |
| 32 // these threads together via cross-thread calls. | 54 // these threads together via cross-thread calls. |
| 33 class MusThreadProxy : public GpuThreadAdapter, | 55 class MusThreadProxy : public GpuThreadAdapter, |
| 34 public InterThreadMessagingProxy, | 56 public InterThreadMessagingProxy, |
| 35 public DrmCursorProxy { | 57 public DrmCursorProxy { |
| 36 public: | 58 public: |
| 37 MusThreadProxy(); | 59 MusThreadProxy(); |
| 38 ~MusThreadProxy() override; | 60 ~MusThreadProxy() override; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 bool GpuCreateWindow(gfx::AcceleratedWidget widget) override; | 110 bool GpuCreateWindow(gfx::AcceleratedWidget widget) override; |
| 89 bool GpuWindowBoundsChanged(gfx::AcceleratedWidget widget, | 111 bool GpuWindowBoundsChanged(gfx::AcceleratedWidget widget, |
| 90 const gfx::Rect& bounds) override; | 112 const gfx::Rect& bounds) override; |
| 91 | 113 |
| 92 // DrmCursorProxy. | 114 // DrmCursorProxy. |
| 93 void CursorSet(gfx::AcceleratedWidget window, | 115 void CursorSet(gfx::AcceleratedWidget window, |
| 94 const std::vector<SkBitmap>& bitmaps, | 116 const std::vector<SkBitmap>& bitmaps, |
| 95 const gfx::Point& point, | 117 const gfx::Point& point, |
| 96 int frame_delay_ms) override; | 118 int frame_delay_ms) override; |
| 97 void Move(gfx::AcceleratedWidget window, const gfx::Point& point) override; | 119 void Move(gfx::AcceleratedWidget window, const gfx::Point& point) override; |
| 120 void MoveEvdev(gfx::AcceleratedWidget window, |
| 121 const gfx::Point& point) override; |
| 98 void InitializeOnEvdev() override; | 122 void InitializeOnEvdev() override; |
| 99 | 123 |
| 100 private: | 124 private: |
| 101 void RunObservers(); | 125 void RunObservers(); |
| 102 void DispatchObserversFromDrmThread(); | 126 void DispatchObserversFromDrmThread(); |
| 103 | 127 |
| 104 void GpuCheckOverlayCapabilitiesCallback( | 128 void GpuCheckOverlayCapabilitiesCallback( |
| 105 gfx::AcceleratedWidget widget, | 129 gfx::AcceleratedWidget widget, |
| 106 const std::vector<OverlayCheck_Params>& overlays) const; | 130 const std::vector<OverlayCheck_Params>& overlays) const; |
| 107 | 131 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 133 base::ThreadChecker on_window_server_thread_; | 157 base::ThreadChecker on_window_server_thread_; |
| 134 | 158 |
| 135 base::WeakPtrFactory<MusThreadProxy> weak_ptr_factory_; | 159 base::WeakPtrFactory<MusThreadProxy> weak_ptr_factory_; |
| 136 | 160 |
| 137 DISALLOW_COPY_AND_ASSIGN(MusThreadProxy); | 161 DISALLOW_COPY_AND_ASSIGN(MusThreadProxy); |
| 138 }; | 162 }; |
| 139 | 163 |
| 140 } // namespace ui | 164 } // namespace ui |
| 141 | 165 |
| 142 #endif // UI_OZONE_PLATFORM_DRM_MUS_THREAD_PROXY_H_ | 166 #endif // UI_OZONE_PLATFORM_DRM_MUS_THREAD_PROXY_H_ |
| OLD | NEW |