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_WRAPPER_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_WRAPPER_H_ |
6 #define UI_OZONE_PLATFORM_DRI_DRI_WRAPPER_H_ | 6 #define UI_OZONE_PLATFORM_DRI_DRI_WRAPPER_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 "ui/gfx/overlay_transform.h" |
| 12 #include "ui/gfx/rect.h" |
| 13 #include "ui/gfx/rect_f.h" |
11 #include "ui/ozone/platform/dri/scoped_drm_types.h" | 14 #include "ui/ozone/platform/dri/scoped_drm_types.h" |
12 | 15 |
13 typedef struct _drmEventContext drmEventContext; | 16 typedef struct _drmEventContext drmEventContext; |
14 typedef struct _drmModeModeInfo drmModeModeInfo; | 17 typedef struct _drmModeModeInfo drmModeModeInfo; |
15 | 18 |
16 namespace ui { | 19 namespace ui { |
17 | 20 |
18 // Wraps DRM calls into a nice interface. Used to provide different | 21 // Wraps DRM calls into a nice interface. Used to provide different |
19 // implementations of the DRM calls. For the actual implementation the DRM API | 22 // implementations of the DRM calls. For the actual implementation the DRM API |
20 // would be called. In unit tests this interface would be stubbed. | 23 // would be called. In unit tests this interface would be stubbed. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // Get the DRM details associated with |framebuffer|. | 63 // Get the DRM details associated with |framebuffer|. |
61 virtual ScopedDrmFramebufferPtr GetFramebuffer(uint32_t framebuffer); | 64 virtual ScopedDrmFramebufferPtr GetFramebuffer(uint32_t framebuffer); |
62 | 65 |
63 // Schedules a pageflip for CRTC |crtc_id|. This function will return | 66 // Schedules a pageflip for CRTC |crtc_id|. This function will return |
64 // immediately. Upon completion of the pageflip event, the CRTC will be | 67 // immediately. Upon completion of the pageflip event, the CRTC will be |
65 // displaying the buffer with ID |framebuffer| and will have a DRM event | 68 // displaying the buffer with ID |framebuffer| and will have a DRM event |
66 // queued on |fd_|. |data| is a generic pointer to some information the user | 69 // queued on |fd_|. |data| is a generic pointer to some information the user |
67 // will receive when processing the pageflip event. | 70 // will receive when processing the pageflip event. |
68 virtual bool PageFlip(uint32_t crtc_id, uint32_t framebuffer, void* data); | 71 virtual bool PageFlip(uint32_t crtc_id, uint32_t framebuffer, void* data); |
69 | 72 |
| 73 // Schedule an overlay to be show during the page flip for CRTC |crtc_id|. |
| 74 // |source| location from |framebuffer| will be shown on overlay |
| 75 // |overlay_plane|, in the bounds specified by |location| on the screen. |
| 76 virtual bool PageFlipOverlay(uint32_t crtc_id, |
| 77 uint32_t framebuffer, |
| 78 const gfx::Rect& location, |
| 79 const gfx::RectF& source, |
| 80 int overlay_plane); |
| 81 |
70 // Returns the property with name |name| associated with |connector|. Returns | 82 // Returns the property with name |name| associated with |connector|. Returns |
71 // NULL if property not found. If the returned value is valid, it must be | 83 // NULL if property not found. If the returned value is valid, it must be |
72 // released using FreeProperty(). | 84 // released using FreeProperty(). |
73 virtual ScopedDrmPropertyPtr GetProperty(drmModeConnector* connector, | 85 virtual ScopedDrmPropertyPtr GetProperty(drmModeConnector* connector, |
74 const char* name); | 86 const char* name); |
75 | 87 |
76 // Sets the value of property with ID |property_id| to |value|. The property | 88 // Sets the value of property with ID |property_id| to |value|. The property |
77 // is applied to the connector with ID |connector_id|. | 89 // is applied to the connector with ID |connector_id|. |
78 virtual bool SetProperty(uint32_t connector_id, | 90 virtual bool SetProperty(uint32_t connector_id, |
79 uint32_t property_id, | 91 uint32_t property_id, |
(...skipping 26 matching lines...) Expand all Loading... |
106 // be performed using this FD. | 118 // be performed using this FD. |
107 int fd_; | 119 int fd_; |
108 | 120 |
109 private: | 121 private: |
110 DISALLOW_COPY_AND_ASSIGN(DriWrapper); | 122 DISALLOW_COPY_AND_ASSIGN(DriWrapper); |
111 }; | 123 }; |
112 | 124 |
113 } // namespace ui | 125 } // namespace ui |
114 | 126 |
115 #endif // UI_OZONE_PLATFORM_DRI_DRI_WRAPPER_H_ | 127 #endif // UI_OZONE_PLATFORM_DRI_DRI_WRAPPER_H_ |
OLD | NEW |