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_HARDWARE_DISPLAY_CONTROLLER_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_HARDWARE_DISPLAY_CONTROLLER_H_ |
6 #define UI_OZONE_PLATFORM_DRI_HARDWARE_DISPLAY_CONTROLLER_H_ | 6 #define UI_OZONE_PLATFORM_DRI_HARDWARE_DISPLAY_CONTROLLER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <xf86drmMode.h> | 10 #include <xf86drmMode.h> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "ui/ozone/platform/dri/dri_wrapper.h" | 16 #include "ui/ozone/platform/dri/dri_wrapper.h" |
17 | 17 |
18 namespace gfx { | 18 namespace gfx { |
19 class Point; | 19 class Point; |
20 } | 20 } |
21 | 21 |
22 namespace ui { | 22 namespace ui { |
23 | 23 |
24 class NativePixmap; | 24 class NativePixmap; |
| 25 class ScanoutBuffer; |
25 class ScanoutSurface; | 26 class ScanoutSurface; |
26 | 27 |
27 typedef std::vector<scoped_refptr<NativePixmap> > NativePixmapList; | 28 typedef std::vector<scoped_refptr<NativePixmap> > NativePixmapList; |
28 | 29 |
29 struct OzoneOverlayPlane { | 30 struct OzoneOverlayPlane { |
30 OzoneOverlayPlane(ScanoutSurface* scanout, | 31 OzoneOverlayPlane(ScanoutSurface* scanout, |
31 int z_order, | 32 int z_order, |
32 gfx::OverlayTransform plane_transform, | 33 gfx::OverlayTransform plane_transform, |
33 const gfx::Rect& display_bounds, | 34 const gfx::Rect& display_bounds, |
34 const gfx::RectF& crop_rect); | 35 const gfx::RectF& crop_rect); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // kernel when a VBlank event finished. This allows the controller to | 144 // kernel when a VBlank event finished. This allows the controller to |
144 // update internal state and propagate the update to the surface. | 145 // update internal state and propagate the update to the surface. |
145 // The tuple (seconds, useconds) represents the event timestamp. |seconds| | 146 // The tuple (seconds, useconds) represents the event timestamp. |seconds| |
146 // represents the number of seconds while |useconds| represents the | 147 // represents the number of seconds while |useconds| represents the |
147 // microseconds (< 1 second) in the timestamp. | 148 // microseconds (< 1 second) in the timestamp. |
148 void OnPageFlipEvent(unsigned int frame, | 149 void OnPageFlipEvent(unsigned int frame, |
149 unsigned int seconds, | 150 unsigned int seconds, |
150 unsigned int useconds); | 151 unsigned int useconds); |
151 | 152 |
152 // Set the hardware cursor to show the contents of |surface|. | 153 // Set the hardware cursor to show the contents of |surface|. |
153 bool SetCursor(ScanoutSurface* surface); | 154 bool SetCursor(scoped_refptr<ScanoutBuffer> buffer); |
154 | 155 |
155 bool UnsetCursor(); | 156 bool UnsetCursor(); |
156 | 157 |
157 // Moves the hardware cursor to |location|. | 158 // Moves the hardware cursor to |location|. |
158 bool MoveCursor(const gfx::Point& location); | 159 bool MoveCursor(const gfx::Point& location); |
159 | 160 |
160 const drmModeModeInfo& get_mode() const { return mode_; }; | 161 const drmModeModeInfo& get_mode() const { return mode_; }; |
161 uint32_t connector_id() const { return connector_id_; } | 162 uint32_t connector_id() const { return connector_id_; } |
162 uint32_t crtc_id() const { return crtc_id_; } | 163 uint32_t crtc_id() const { return crtc_id_; } |
163 ScanoutSurface* surface() const { | 164 ScanoutSurface* surface() const { |
(...skipping 16 matching lines...) Expand all Loading... |
180 | 181 |
181 // TODO(dnicoara) Need to allow a CRTC to have multiple connectors. | 182 // TODO(dnicoara) Need to allow a CRTC to have multiple connectors. |
182 uint32_t connector_id_; | 183 uint32_t connector_id_; |
183 | 184 |
184 uint32_t crtc_id_; | 185 uint32_t crtc_id_; |
185 | 186 |
186 drmModeModeInfo mode_; | 187 drmModeModeInfo mode_; |
187 | 188 |
188 scoped_ptr<ScanoutSurface> surface_; | 189 scoped_ptr<ScanoutSurface> surface_; |
189 | 190 |
| 191 scoped_refptr<ScanoutBuffer> cursor_buffer_; |
| 192 |
190 uint64_t time_of_last_flip_; | 193 uint64_t time_of_last_flip_; |
191 | 194 |
192 // Keeps track of the CRTC state. If a surface has been bound, then the value | 195 // Keeps track of the CRTC state. If a surface has been bound, then the value |
193 // is set to false. Otherwise it is true. | 196 // is set to false. Otherwise it is true. |
194 bool is_disabled_; | 197 bool is_disabled_; |
195 | 198 |
196 // Store the state of the CRTC before we took over. Used to restore the CRTC | 199 // Store the state of the CRTC before we took over. Used to restore the CRTC |
197 // once we no longer need it. | 200 // once we no longer need it. |
198 ScopedDrmCrtcPtr saved_crtc_; | 201 ScopedDrmCrtcPtr saved_crtc_; |
199 | 202 |
200 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayController); | 203 DISALLOW_COPY_AND_ASSIGN(HardwareDisplayController); |
201 }; | 204 }; |
202 | 205 |
203 } // namespace ui | 206 } // namespace ui |
204 | 207 |
205 #endif // UI_OZONE_PLATFORM_DRI_HARDWARE_DISPLAY_CONTROLLER_H_ | 208 #endif // UI_OZONE_PLATFORM_DRI_HARDWARE_DISPLAY_CONTROLLER_H_ |
OLD | NEW |