render/allocator: introduce wlr_allocator_autocreate

This commit is contained in:
Simon Zeni 2021-04-23 17:06:21 -04:00 committed by Simon Ser
parent 982498fab3
commit 318e3ac92c
2 changed files with 49 additions and 0 deletions

View file

@ -7,6 +7,8 @@
#include <wlr/render/drm_format_set.h>
struct wlr_allocator;
struct wlr_backend;
struct wlr_renderer;
struct wlr_allocator_interface {
struct wlr_buffer *(*create_buffer)(struct wlr_allocator *alloc,
@ -22,6 +24,11 @@ struct wlr_allocator {
} events;
};
/**
* Creates the adequate wlr_allocator given a backend and a renderer
*/
struct wlr_allocator *wlr_allocator_autocreate(struct wlr_backend *backend,
struct wlr_renderer *renderer);
/**
* Destroy the allocator.
*/