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_DRM_HOST_DRM_WINDOW_HOST_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRM_HOST_DRM_WINDOW_HOST_H_ |
6 #define UI_OZONE_PLATFORM_DRM_HOST_DRM_WINDOW_HOST_H_ | 6 #define UI_OZONE_PLATFORM_DRM_HOST_DRM_WINDOW_HOST_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "ui/display/types/display_snapshot.h" | 12 #include "ui/display/types/display_snapshot.h" |
13 #include "ui/events/platform/platform_event_dispatcher.h" | 13 #include "ui/events/platform/platform_event_dispatcher.h" |
14 #include "ui/gfx/geometry/rect.h" | 14 #include "ui/gfx/geometry/rect.h" |
15 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
16 #include "ui/ozone/platform/drm/host/channel_observer.h" | 16 #include "ui/ozone/platform/drm/host/channel_observer.h" |
17 #include "ui/platform_window/platform_window.h" | 17 #include "ui/platform_window/platform_window.h" |
18 | 18 |
19 namespace ui { | 19 namespace ui { |
20 | 20 |
21 class DrmDisplayHostManager; | 21 class DrmDisplayHostManager; |
22 class DrmCursor; | 22 class DrmCursor; |
23 class DrmGpuPlatformSupportHost; | 23 class DrmGpuPlatformSupportHost; |
24 class DrmOverlayCandidatesHostCore; | |
25 class DrmGpuWindow; | 24 class DrmGpuWindow; |
| 25 class DrmOverlayManager; |
26 class DrmWindowHostManager; | 26 class DrmWindowHostManager; |
27 class EventFactoryEvdev; | 27 class EventFactoryEvdev; |
28 | 28 |
29 // Implementation of the platform window. This object and its handle |widget_| | 29 // Implementation of the platform window. This object and its handle |widget_| |
30 // uniquely identify a window. Since the DRI/GBM platform is split into 2 | 30 // uniquely identify a window. Since the DRI/GBM platform is split into 2 |
31 // pieces (Browser process and GPU process), internally we need to make sure the | 31 // pieces (Browser process and GPU process), internally we need to make sure the |
32 // state is synchronized between the 2 processes. | 32 // state is synchronized between the 2 processes. |
33 // | 33 // |
34 // |widget_| is used in both processes to uniquely identify the window. This | 34 // |widget_| is used in both processes to uniquely identify the window. This |
35 // means that any state on the browser side needs to be propagated to the GPU. | 35 // means that any state on the browser side needs to be propagated to the GPU. |
36 // State propagation needs to happen before the state change is acknowledged to | 36 // State propagation needs to happen before the state change is acknowledged to |
37 // |delegate_| as |delegate_| is responsible for initializing the surface | 37 // |delegate_| as |delegate_| is responsible for initializing the surface |
38 // associated with the window (the surface is created on the GPU process). | 38 // associated with the window (the surface is created on the GPU process). |
39 class DrmWindowHost : public PlatformWindow, | 39 class DrmWindowHost : public PlatformWindow, |
40 public PlatformEventDispatcher, | 40 public PlatformEventDispatcher, |
41 public ChannelObserver { | 41 public ChannelObserver { |
42 public: | 42 public: |
43 DrmWindowHost(PlatformWindowDelegate* delegate, | 43 DrmWindowHost(PlatformWindowDelegate* delegate, |
44 const gfx::Rect& bounds, | 44 const gfx::Rect& bounds, |
45 DrmGpuPlatformSupportHost* sender, | 45 DrmGpuPlatformSupportHost* sender, |
46 EventFactoryEvdev* event_factory, | 46 EventFactoryEvdev* event_factory, |
47 DrmCursor* cursor, | 47 DrmCursor* cursor, |
48 DrmWindowHostManager* window_manager, | 48 DrmWindowHostManager* window_manager, |
49 DrmDisplayHostManager* display_manager); | 49 DrmDisplayHostManager* display_manager, |
| 50 DrmOverlayManager* overlay_manager); |
50 ~DrmWindowHost() override; | 51 ~DrmWindowHost() override; |
51 | 52 |
52 void Initialize(); | 53 void Initialize(); |
53 | 54 |
54 gfx::AcceleratedWidget GetAcceleratedWidget(); | 55 gfx::AcceleratedWidget GetAcceleratedWidget(); |
55 | 56 |
56 gfx::Rect GetCursorConfinedBounds() const; | 57 gfx::Rect GetCursorConfinedBounds() const; |
57 | 58 |
58 // PlatformWindow: | 59 // PlatformWindow: |
59 void Show() override; | 60 void Show() override; |
(...skipping 14 matching lines...) Expand all Loading... |
74 PlatformImeController* GetPlatformImeController() override; | 75 PlatformImeController* GetPlatformImeController() override; |
75 | 76 |
76 // PlatformEventDispatcher: | 77 // PlatformEventDispatcher: |
77 bool CanDispatchEvent(const PlatformEvent& event) override; | 78 bool CanDispatchEvent(const PlatformEvent& event) override; |
78 uint32_t DispatchEvent(const PlatformEvent& event) override; | 79 uint32_t DispatchEvent(const PlatformEvent& event) override; |
79 | 80 |
80 // ChannelObserver: | 81 // ChannelObserver: |
81 void OnChannelEstablished() override; | 82 void OnChannelEstablished() override; |
82 void OnChannelDestroyed() override; | 83 void OnChannelDestroyed() override; |
83 | 84 |
84 void SetOverlayCandidatesHost(DrmOverlayCandidatesHostCore* host); | |
85 | |
86 private: | 85 private: |
87 void SendBoundsChange(); | 86 void SendBoundsChange(); |
88 | 87 |
89 PlatformWindowDelegate* delegate_; // Not owned. | 88 PlatformWindowDelegate* delegate_; // Not owned. |
90 DrmGpuPlatformSupportHost* sender_; // Not owned. | 89 DrmGpuPlatformSupportHost* sender_; // Not owned. |
91 EventFactoryEvdev* event_factory_; // Not owned. | 90 EventFactoryEvdev* event_factory_; // Not owned. |
92 DrmCursor* cursor_; // Not owned. | 91 DrmCursor* cursor_; // Not owned. |
93 DrmWindowHostManager* window_manager_; // Not owned. | 92 DrmWindowHostManager* window_manager_; // Not owned. |
94 DrmDisplayHostManager* display_manager_; // Not owned. | 93 DrmDisplayHostManager* display_manager_; // Not owned. |
95 DrmOverlayCandidatesHostCore* overlay_candidates_host_; // Not owned. | 94 DrmOverlayManager* overlay_manager_; // Not owned. |
96 | 95 |
97 gfx::Rect bounds_; | 96 gfx::Rect bounds_; |
98 gfx::AcceleratedWidget widget_; | 97 gfx::AcceleratedWidget widget_; |
99 | 98 |
100 gfx::Rect cursor_confined_bounds_; | 99 gfx::Rect cursor_confined_bounds_; |
101 | 100 |
102 DISALLOW_COPY_AND_ASSIGN(DrmWindowHost); | 101 DISALLOW_COPY_AND_ASSIGN(DrmWindowHost); |
103 }; | 102 }; |
104 | 103 |
105 } // namespace ui | 104 } // namespace ui |
106 | 105 |
107 #endif // UI_OZONE_PLATFORM_DRM_HOST_DRM_WINDOW_HOST_H_ | 106 #endif // UI_OZONE_PLATFORM_DRM_HOST_DRM_WINDOW_HOST_H_ |
OLD | NEW |