| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "ui/ozone/platform/drm/host/drm_cursor.h" | 5 #include "ui/ozone/platform/drm/host/drm_cursor.h" |
| 6 | 6 |
| 7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" | 8 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" |
| 9 #include "ui/gfx/geometry/point.h" | 9 #include "ui/gfx/geometry/point.h" |
| 10 #include "ui/gfx/geometry/point_conversions.h" | 10 #include "ui/gfx/geometry/point_conversions.h" |
| 11 #include "ui/gfx/geometry/point_f.h" | 11 #include "ui/gfx/geometry/point_f.h" |
| 12 #include "ui/ozone/common/gpu/ozone_gpu_messages.h" | 12 #include "ui/ozone/common/gpu/ozone_gpu_messages.h" |
| 13 #include "ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h" | |
| 14 #include "ui/ozone/platform/drm/host/drm_window_host.h" | 13 #include "ui/ozone/platform/drm/host/drm_window_host.h" |
| 15 #include "ui/ozone/platform/drm/host/drm_window_host_manager.h" | 14 #include "ui/ozone/platform/drm/host/drm_window_host_manager.h" |
| 16 | 15 |
| 17 #if defined(OS_CHROMEOS) | 16 #if defined(OS_CHROMEOS) |
| 18 #include "ui/events/ozone/chromeos/cursor_controller.h" | 17 #include "ui/events/ozone/chromeos/cursor_controller.h" |
| 19 #endif | 18 #endif |
| 20 | 19 |
| 21 namespace ui { | 20 namespace ui { |
| 22 | 21 |
| 23 DrmCursor::DrmCursor(DrmWindowHostManager* window_manager, | 22 DrmCursor::DrmCursor(DrmWindowHostManager* window_manager) |
| 24 DrmGpuPlatformSupportHost* gpu_platform_support_host) | 23 : window_manager_(window_manager) { |
| 25 : window_manager_(window_manager), | |
| 26 gpu_platform_support_host_(gpu_platform_support_host) { | |
| 27 } | 24 } |
| 28 | 25 |
| 29 DrmCursor::~DrmCursor() { | 26 DrmCursor::~DrmCursor() { |
| 30 gpu_platform_support_host_->UnregisterHandler(this); | |
| 31 } | |
| 32 | |
| 33 void DrmCursor::Init() { | |
| 34 gpu_platform_support_host_->RegisterHandler(this); | |
| 35 } | 27 } |
| 36 | 28 |
| 37 void DrmCursor::SetCursor(gfx::AcceleratedWidget window, | 29 void DrmCursor::SetCursor(gfx::AcceleratedWidget window, |
| 38 PlatformCursor platform_cursor) { | 30 PlatformCursor platform_cursor) { |
| 39 DCHECK(ui_task_runner_->BelongsToCurrentThread()); | 31 DCHECK(ui_task_runner_->BelongsToCurrentThread()); |
| 40 DCHECK_NE(window, gfx::kNullAcceleratedWidget); | 32 DCHECK_NE(window, gfx::kNullAcceleratedWidget); |
| 41 | 33 |
| 42 scoped_refptr<BitmapCursorOzone> bitmap = | 34 scoped_refptr<BitmapCursorOzone> bitmap = |
| 43 BitmapCursorFactoryOzone::GetBitmapCursor(platform_cursor); | 35 BitmapCursorFactoryOzone::GetBitmapCursor(platform_cursor); |
| 44 | 36 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 } | 287 } |
| 296 | 288 |
| 297 DrmCursor::CursorState::CursorState() | 289 DrmCursor::CursorState::CursorState() |
| 298 : window(gfx::kNullAcceleratedWidget), host_id(-1) { | 290 : window(gfx::kNullAcceleratedWidget), host_id(-1) { |
| 299 } | 291 } |
| 300 | 292 |
| 301 DrmCursor::CursorState::~CursorState() { | 293 DrmCursor::CursorState::~CursorState() { |
| 302 } | 294 } |
| 303 | 295 |
| 304 } // namespace ui | 296 } // namespace ui |
| OLD | NEW |