Index: ui/ozone/platform/drm/gpu/drm_thread.h |
diff --git a/ui/ozone/platform/drm/gpu/drm_thread.h b/ui/ozone/platform/drm/gpu/drm_thread.h |
index 5e0a3c674740ab2757ae2affb70e66123f84c2e0..1bd53c615130ef19636722a43536ee3e90eb7c92 100644 |
--- a/ui/ozone/platform/drm/gpu/drm_thread.h |
+++ b/ui/ozone/platform/drm/gpu/drm_thread.h |
@@ -13,10 +13,13 @@ |
#include "base/macros.h" |
#include "base/memory/weak_ptr.h" |
#include "base/threading/thread.h" |
+#include "mojo/public/cpp/bindings/binding_set.h" |
+#include "services/shell/public/cpp/connection.h" |
#include "ui/gfx/native_pixmap_handle_ozone.h" |
#include "ui/gfx/native_widget_types.h" |
#include "ui/gfx/vsync_provider.h" |
#include "ui/ozone/common/gpu/ozone_gpu_message_params.h" |
+#include "ui/ozone/public/interfaces/cursor.mojom.h" |
#include "ui/ozone/public/surface_ozone_egl.h" |
namespace base { |
@@ -28,6 +31,10 @@ class Point; |
class Rect; |
} |
+namespace shell { |
+class Connection; |
+} |
+ |
namespace ui { |
class DrmDeviceManager; |
@@ -48,7 +55,7 @@ struct OverlayPlane; |
// (for example jank in the cursor if the GPU main thread is performing heavy |
// operations). The inverse is also true as blocking operations on the DRM |
// thread (such as modesetting) no longer block the GPU main thread. |
-class DrmThread : public base::Thread { |
+class DrmThread : public base::Thread, public ozone::mojom::Cursor { |
public: |
DrmThread(); |
~DrmThread() override; |
@@ -79,10 +86,10 @@ class DrmThread : public base::Thread { |
void CreateWindow(gfx::AcceleratedWidget widget); |
void DestroyWindow(gfx::AcceleratedWidget widget); |
void SetWindowBounds(gfx::AcceleratedWidget widget, const gfx::Rect& bounds); |
- void SetCursor(gfx::AcceleratedWidget widget, |
+ void SetCursor(const gfx::AcceleratedWidget& widget, |
const std::vector<SkBitmap>& bitmaps, |
const gfx::Point& location, |
- int frame_delay_ms); |
+ uint32_t frame_delay_ms); |
void MoveCursor(const gfx::AcceleratedWidget& widget, |
const gfx::Point& location); |
void CheckOverlayCapabilities( |
@@ -121,12 +128,20 @@ class DrmThread : public base::Thread { |
// base::Thread: |
void Init() override; |
+ // Mojo support for CursorRequest. |
+ void AddBinding(shell::Connection* connection, |
+ ozone::mojom::CursorRequest request); |
+ |
private: |
std::unique_ptr<DrmDeviceManager> device_manager_; |
std::unique_ptr<ScanoutBufferGenerator> buffer_generator_; |
std::unique_ptr<ScreenManager> screen_manager_; |
std::unique_ptr<DrmGpuDisplayManager> display_manager_; |
+ // The mojo implementation requires a BindingSet because the DrmThread serves |
+ // requests from two different client threads. |
+ mojo::BindingSet<ozone::mojom::Cursor> bindings_; |
+ |
DISALLOW_COPY_AND_ASSIGN(DrmThread); |
}; |