| 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 #ifndef UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_ |
| 6 #define UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_ | 6 #define UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/timer/timer.h" |
| 11 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
| 12 #include "ui/ozone/platform/dri/hardware_cursor_delegate.h" | 13 #include "ui/ozone/platform/dri/hardware_cursor_delegate.h" |
| 13 #include "ui/ozone/public/surface_factory_ozone.h" | 14 #include "ui/ozone/public/surface_factory_ozone.h" |
| 14 | 15 |
| 15 namespace ui { | 16 namespace ui { |
| 16 | 17 |
| 17 class DriBuffer; | 18 class DriBuffer; |
| 18 class DriWindowManager; | 19 class DriWindowManager; |
| 19 class DriWrapper; | 20 class DriWrapper; |
| 20 class ScreenManager; | 21 class ScreenManager; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // HardwareCursorDelegate: | 57 // HardwareCursorDelegate: |
| 57 void SetHardwareCursor(gfx::AcceleratedWidget widget, | 58 void SetHardwareCursor(gfx::AcceleratedWidget widget, |
| 58 const std::vector<SkBitmap>& bitmaps, | 59 const std::vector<SkBitmap>& bitmaps, |
| 59 const gfx::Point& location, | 60 const gfx::Point& location, |
| 60 int frame_delay_ms) OVERRIDE; | 61 int frame_delay_ms) OVERRIDE; |
| 61 virtual void MoveHardwareCursor(gfx::AcceleratedWidget window, | 62 virtual void MoveHardwareCursor(gfx::AcceleratedWidget window, |
| 62 const gfx::Point& location) OVERRIDE; | 63 const gfx::Point& location) OVERRIDE; |
| 63 | 64 |
| 64 protected: | 65 protected: |
| 65 // Draw the last set cursor & update the cursor plane. | 66 // Draw the last set cursor & update the cursor plane. |
| 66 void ResetCursor(gfx::AcceleratedWidget w); | 67 void ResetCursor(); |
| 68 |
| 69 // Draw next frame in an animated cursor. |
| 70 void OnCursorAnimationTimeout(); |
| 67 | 71 |
| 68 DriWrapper* drm_; // Not owned. | 72 DriWrapper* drm_; // Not owned. |
| 69 ScreenManager* screen_manager_; // Not owned. | 73 ScreenManager* screen_manager_; // Not owned. |
| 70 DriWindowManager* window_manager_; // Not owned. | 74 DriWindowManager* window_manager_; // Not owned. |
| 71 HardwareState state_; | 75 HardwareState state_; |
| 72 | 76 |
| 73 scoped_refptr<DriBuffer> cursor_buffers_[2]; | 77 scoped_refptr<DriBuffer> cursor_buffers_[2]; |
| 74 int cursor_frontbuffer_; | 78 int cursor_frontbuffer_; |
| 75 | 79 |
| 80 gfx::AcceleratedWidget cursor_widget_; |
| 76 std::vector<SkBitmap> cursor_bitmaps_; | 81 std::vector<SkBitmap> cursor_bitmaps_; |
| 77 gfx::Point cursor_location_; | 82 gfx::Point cursor_location_; |
| 83 int cursor_frame_; |
| 78 int cursor_frame_delay_ms_; | 84 int cursor_frame_delay_ms_; |
| 85 base::RepeatingTimer<DriSurfaceFactory> cursor_timer_; |
| 79 | 86 |
| 80 DISALLOW_COPY_AND_ASSIGN(DriSurfaceFactory); | 87 DISALLOW_COPY_AND_ASSIGN(DriSurfaceFactory); |
| 81 }; | 88 }; |
| 82 | 89 |
| 83 } // namespace ui | 90 } // namespace ui |
| 84 | 91 |
| 85 #endif // UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_ | 92 #endif // UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_ |
| OLD | NEW |