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 abcebac818e076921403808c03d500837a21cd4b..c8c7bbc29286f7dc3e22067defdae13c7e1f7479 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/device_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::DeviceCursor { |
public: |
DrmThread(); |
~DrmThread() override; |
@@ -80,10 +87,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); |
spang
2016/07/27 17:00:59
Should it really be unsigned? I'd say int is the c
rjkroege
2016/07/27 20:55:13
But negative time into the future? That makes me s
|
void MoveCursor(const gfx::AcceleratedWidget& widget, |
const gfx::Point& location); |
void CheckOverlayCapabilities( |
@@ -122,12 +129,19 @@ class DrmThread : public base::Thread { |
// base::Thread: |
void Init() override; |
+ // Mojo support for DeviceCursorRequest. |
+ void AddBinding(ozone::mojom::DeviceCursorRequest 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::DeviceCursor> bindings_; |
+ |
DISALLOW_COPY_AND_ASSIGN(DrmThread); |
}; |