render: add wlr_renderer.events.lost

This commit is contained in:
Simon Ser 2022-11-13 17:08:00 +01:00 committed by Simon Zeni
parent 48541d2f2e
commit 31ea61b390
2 changed files with 7 additions and 0 deletions

View file

@ -26,6 +26,12 @@ struct wlr_fbox;
struct wlr_renderer { struct wlr_renderer {
struct { struct {
struct wl_signal destroy; struct wl_signal destroy;
/**
* Emitted when the GPU is lost, e.g. on GPU reset.
*
* Compositors should destroy the renderer and re-create it.
*/
struct wl_signal lost;
} events; } events;
// private state // private state

View file

@ -44,6 +44,7 @@ void wlr_renderer_init(struct wlr_renderer *renderer,
renderer->impl = impl; renderer->impl = impl;
wl_signal_init(&renderer->events.destroy); wl_signal_init(&renderer->events.destroy);
wl_signal_init(&renderer->events.lost);
} }
void wlr_renderer_destroy(struct wlr_renderer *r) { void wlr_renderer_destroy(struct wlr_renderer *r) {