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_WINDOW_DELEGATE_IMPL_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_IMPL_H_ |
6 #define UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_IMPL_H_ | 6 #define UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_IMPL_H_ |
7 | 7 |
8 #include "base/timer/timer.h" | 8 #include "base/timer/timer.h" |
9 #include "ui/gfx/geometry/point.h" | 9 #include "ui/gfx/geometry/point.h" |
10 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
12 #include "ui/ozone/ozone_export.h" | 12 #include "ui/ozone/ozone_export.h" |
13 #include "ui/ozone/platform/dri/display_change_observer.h" | 13 #include "ui/ozone/platform/dri/display_change_observer.h" |
14 #include "ui/ozone/platform/dri/dri_window_delegate.h" | 14 #include "ui/ozone/platform/dri/dri_window_delegate.h" |
15 | 15 |
16 namespace ui { | 16 namespace ui { |
17 | 17 |
18 class DriBuffer; | 18 class DriBuffer; |
19 class DriWindowDelegateManager; | |
20 class DrmDeviceManager; | 19 class DrmDeviceManager; |
21 class HardwareDisplayController; | 20 class HardwareDisplayController; |
22 class ScreenManager; | 21 class ScreenManager; |
23 | 22 |
24 class OZONE_EXPORT DriWindowDelegateImpl : public DriWindowDelegate, | 23 class OZONE_EXPORT DriWindowDelegateImpl : public DriWindowDelegate, |
25 public DisplayChangeObserver { | 24 public DisplayChangeObserver { |
26 public: | 25 public: |
27 DriWindowDelegateImpl(gfx::AcceleratedWidget widget, | 26 DriWindowDelegateImpl(gfx::AcceleratedWidget widget, |
28 DrmDeviceManager* device_manager, | 27 DrmDeviceManager* device_manager, |
29 DriWindowDelegateManager* window_manager, | |
30 ScreenManager* screen_manager); | 28 ScreenManager* screen_manager); |
31 ~DriWindowDelegateImpl() override; | 29 ~DriWindowDelegateImpl() override; |
32 | 30 |
33 // DriWindowDelegate: | 31 // DriWindowDelegate: |
34 void Initialize() override; | 32 void Initialize() override; |
35 void Shutdown() override; | 33 void Shutdown() override; |
36 gfx::AcceleratedWidget GetAcceleratedWidget() override; | 34 gfx::AcceleratedWidget GetAcceleratedWidget() override; |
37 HardwareDisplayController* GetController() override; | 35 HardwareDisplayController* GetController() override; |
38 void OnBoundsChanged(const gfx::Rect& bounds) override; | 36 void OnBoundsChanged(const gfx::Rect& bounds) override; |
39 void SetCursor(const std::vector<SkBitmap>& bitmaps, | 37 void SetCursor(const std::vector<SkBitmap>& bitmaps, |
(...skipping 12 matching lines...) Expand all Loading... |
52 void ResetCursor(bool bitmap_only); | 50 void ResetCursor(bool bitmap_only); |
53 | 51 |
54 // Draw next frame in an animated cursor. | 52 // Draw next frame in an animated cursor. |
55 void OnCursorAnimationTimeout(); | 53 void OnCursorAnimationTimeout(); |
56 | 54 |
57 void UpdateWidgetToDrmDeviceMapping(); | 55 void UpdateWidgetToDrmDeviceMapping(); |
58 | 56 |
59 gfx::AcceleratedWidget widget_; | 57 gfx::AcceleratedWidget widget_; |
60 | 58 |
61 DrmDeviceManager* device_manager_; // Not owned. | 59 DrmDeviceManager* device_manager_; // Not owned. |
62 DriWindowDelegateManager* window_manager_; // Not owned. | |
63 ScreenManager* screen_manager_; // Not owned. | 60 ScreenManager* screen_manager_; // Not owned. |
64 | 61 |
65 // The current bounds of the window. | 62 // The current bounds of the window. |
66 gfx::Rect bounds_; | 63 gfx::Rect bounds_; |
67 | 64 |
68 // The controller associated with the current window. This may be nullptr if | 65 // The controller associated with the current window. This may be nullptr if |
69 // the window isn't over an active display. | 66 // the window isn't over an active display. |
70 HardwareDisplayController* controller_; | 67 HardwareDisplayController* controller_; |
71 | 68 |
72 base::RepeatingTimer<DriWindowDelegateImpl> cursor_timer_; | 69 base::RepeatingTimer<DriWindowDelegateImpl> cursor_timer_; |
73 | 70 |
74 scoped_refptr<DriBuffer> cursor_buffers_[2]; | 71 scoped_refptr<DriBuffer> cursor_buffers_[2]; |
75 int cursor_frontbuffer_; | 72 int cursor_frontbuffer_; |
76 | 73 |
77 std::vector<SkBitmap> cursor_bitmaps_; | 74 std::vector<SkBitmap> cursor_bitmaps_; |
78 gfx::Point cursor_location_; | 75 gfx::Point cursor_location_; |
79 int cursor_frame_; | 76 int cursor_frame_; |
80 int cursor_frame_delay_ms_; | 77 int cursor_frame_delay_ms_; |
81 | 78 |
82 DISALLOW_COPY_AND_ASSIGN(DriWindowDelegateImpl); | 79 DISALLOW_COPY_AND_ASSIGN(DriWindowDelegateImpl); |
83 }; | 80 }; |
84 | 81 |
85 } // namespace ui | 82 } // namespace ui |
86 | 83 |
87 #endif // UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_IMPL_H_ | 84 #endif // UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_IMPL_H_ |
OLD | NEW |