libweston: Add a helper for retrieving backend type
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
parent
d88782bf41
commit
14cfb97949
|
@ -2202,6 +2202,8 @@ void
|
|||
weston_output_schedule_repaint_reset(struct weston_output *output);
|
||||
void
|
||||
weston_output_schedule_repaint_restart(struct weston_output *output);
|
||||
enum weston_compositor_backend
|
||||
weston_get_backend_type(struct weston_backend *backend);
|
||||
void
|
||||
weston_compositor_schedule_repaint(struct weston_compositor *compositor);
|
||||
void
|
||||
|
|
|
@ -129,6 +129,11 @@ struct weston_backend {
|
|||
*/
|
||||
bool (*can_scanout_dmabuf)(struct weston_backend *backend,
|
||||
struct linux_dmabuf_buffer *buffer);
|
||||
|
||||
/** Identifies a particular backend_type from one
|
||||
* defined in weston_compositor_backend.
|
||||
*/
|
||||
enum weston_compositor_backend backend_type;
|
||||
};
|
||||
|
||||
/* weston_head */
|
||||
|
|
|
@ -10189,6 +10189,7 @@ weston_compositor_load_backend(struct weston_compositor *compositor,
|
|||
return NULL;
|
||||
|
||||
b = wl_container_of(compositor->backend_list.next, b, link);
|
||||
b->backend_type = backend;
|
||||
|
||||
/* Return the last loaded backend. */
|
||||
return b;
|
||||
|
@ -10456,3 +10457,21 @@ weston_output_finish_frame_from_timer(struct weston_output *output)
|
|||
|
||||
weston_output_finish_frame(output, &ts, 0);
|
||||
}
|
||||
|
||||
/** Retrieve the backend type of as described in enum
|
||||
* weston_compositor_backend.
|
||||
*
|
||||
* Note that the backend must be loaded, with weston_compositor_load_backend
|
||||
*
|
||||
* \param backend weston_backend in question
|
||||
* \returns a type of enum weston_compositor_backend
|
||||
*
|
||||
* \sa weston_compositor_load_backend
|
||||
*
|
||||
*/
|
||||
WL_EXPORT enum weston_compositor_backend
|
||||
weston_get_backend_type(struct weston_backend *backend)
|
||||
{
|
||||
assert(backend);
|
||||
return backend->backend_type;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue