| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_HOST_DRM_CURSOR_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_HOST_DRM_CURSOR_H_ |
| 6 #define UI_OZONE_PLATFORM_DRM_HOST_DRM_CURSOR_H_ | 6 #define UI_OZONE_PLATFORM_DRM_HOST_DRM_CURSOR_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 // Sets the cursor |bitmaps| on |window| at |point| with |frame_delay_ms|. | 28 // Sets the cursor |bitmaps| on |window| at |point| with |frame_delay_ms|. |
| 29 virtual void CursorSet(gfx::AcceleratedWidget window, | 29 virtual void CursorSet(gfx::AcceleratedWidget window, |
| 30 const std::vector<SkBitmap>& bitmaps, | 30 const std::vector<SkBitmap>& bitmaps, |
| 31 const gfx::Point& point, | 31 const gfx::Point& point, |
| 32 int frame_delay_ms) = 0; | 32 int frame_delay_ms) = 0; |
| 33 // Moves the cursor in |window| to |point|. | 33 // Moves the cursor in |window| to |point|. |
| 34 virtual void Move(gfx::AcceleratedWidget window, const gfx::Point& point) = 0; | 34 virtual void Move(gfx::AcceleratedWidget window, const gfx::Point& point) = 0; |
| 35 | 35 |
| 36 // Initialize EvdevThread-specific state. | 36 // Initialize EvdevThread-specific state. |
| 37 virtual void InitializeOnEvdev() = 0; | 37 virtual void InitializeOnEvdevIfNecessary() = 0; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 // DrmCursor manages all cursor state and semantics. | 40 // DrmCursor manages all cursor state and semantics. |
| 41 class DrmCursor : public CursorDelegateEvdev { | 41 class DrmCursor : public CursorDelegateEvdev { |
| 42 public: | 42 public: |
| 43 explicit DrmCursor(DrmWindowHostManager* window_manager); | 43 explicit DrmCursor(DrmWindowHostManager* window_manager); |
| 44 ~DrmCursor() override; | 44 ~DrmCursor() override; |
| 45 | 45 |
| 46 // Sets or resets the DrmProxy |proxy|. If |proxy| is set, the DrmCursor uses | 46 // Sets or the DrmProxy |proxy|. If |proxy| is set, the DrmCursor uses |
| 47 // it to communicate to the GPU process or thread. | 47 // it to communicate to the GPU process or thread. Returns the previous |
| 48 void SetDrmCursorProxy(DrmCursorProxy* proxy); | 48 // value. |
| 49 void SetDrmCursorProxy(std::unique_ptr<DrmCursorProxy> proxy); |
| 49 void ResetDrmCursorProxy(); | 50 void ResetDrmCursorProxy(); |
| 50 | 51 |
| 51 // Change the cursor over the specifed window. | 52 // Change the cursor over the specifed window. |
| 52 void SetCursor(gfx::AcceleratedWidget window, PlatformCursor platform_cursor); | 53 void SetCursor(gfx::AcceleratedWidget window, PlatformCursor platform_cursor); |
| 53 | 54 |
| 54 // Handle window lifecycle. | 55 // Handle window lifecycle. |
| 55 void OnWindowAdded(gfx::AcceleratedWidget window, | 56 void OnWindowAdded(gfx::AcceleratedWidget window, |
| 56 const gfx::Rect& bounds_in_screen, | 57 const gfx::Rect& bounds_in_screen, |
| 57 const gfx::Rect& cursor_confined_bounds); | 58 const gfx::Rect& cursor_confined_bounds); |
| 58 void OnWindowRemoved(gfx::AcceleratedWidget window); | 59 void OnWindowRemoved(gfx::AcceleratedWidget window); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 DrmWindowHostManager* window_manager_; // Not owned. | 114 DrmWindowHostManager* window_manager_; // Not owned. |
| 114 | 115 |
| 115 std::unique_ptr<DrmCursorProxy> proxy_; | 116 std::unique_ptr<DrmCursorProxy> proxy_; |
| 116 | 117 |
| 117 DISALLOW_COPY_AND_ASSIGN(DrmCursor); | 118 DISALLOW_COPY_AND_ASSIGN(DrmCursor); |
| 118 }; | 119 }; |
| 119 | 120 |
| 120 } // namespace ui | 121 } // namespace ui |
| 121 | 122 |
| 122 #endif // UI_OZONE_PLATFORM_DRM_HOST_DRM_CURSOR_H_ | 123 #endif // UI_OZONE_PLATFORM_DRM_HOST_DRM_CURSOR_H_ |
| OLD | NEW |