compositor: add wlr_compositor_set_renderer()

Allows compositors to switch the wlr_renderer at runtime.

Useful for handling GPU resets.
This commit is contained in:
Simon Ser 2024-03-14 14:34:44 +01:00
parent 3075e6a6f9
commit 0e5034d8ba
2 changed files with 24 additions and 6 deletions

View file

@ -524,4 +524,16 @@ const pixman_region32_t *wlr_region_from_resource(struct wl_resource *resource);
struct wlr_compositor *wlr_compositor_create(struct wl_display *display,
uint32_t version, struct wlr_renderer *renderer);
/**
* Set the renderer used for creating struct wlr_texture objects from client
* buffers on surface commit.
*
* The renderer may be NULL, in which case no textures are created.
*
* Calling this function does not update existing textures, it only affects
* future surface commits.
*/
void wlr_compositor_set_renderer(struct wlr_compositor *compositor,
struct wlr_renderer *renderer);
#endif