render: add wlr_renderer_init_wl_shm

This allows compositors to initialize wl_shm without initializing
other globals like linux-dmabuf.
This commit is contained in:
Simon Ser 2021-06-07 16:31:53 +02:00
parent c9f3c2b4f7
commit 77d811a21b
2 changed files with 26 additions and 6 deletions

View file

@ -99,13 +99,19 @@ bool wlr_renderer_read_pixels(struct wlr_renderer *r, uint32_t fmt,
uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y, void *data);
/**
* Creates necessary shm and invokes the initialization of the implementation.
* Initializes wl_shm, linux-dmabuf and other buffer factory protocols.
*
* Returns false on failure.
*/
bool wlr_renderer_init_wl_display(struct wlr_renderer *r,
struct wl_display *wl_display);
/**
* Initializes wl_shm on the provided wl_display.
*/
bool wlr_renderer_init_wl_shm(struct wlr_renderer *r,
struct wl_display *wl_display);
/**
* Obtains the FD of the DRM device used for rendering, or -1 if unavailable.
*