From 6129a6f93e97680dfe7e983db2ee7671edb5ffbe Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 6 Apr 2020 13:27:05 +0200 Subject: backend/headless: add wlr_headless_backend_create_with_renderer This allows one to create a headless backend with an existing renderer. --- include/backend/headless.h | 3 ++- include/wlr/backend/headless.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/backend/headless.h b/include/backend/headless.h index d8cb4dc2..564cb154 100644 --- a/include/backend/headless.h +++ b/include/backend/headless.h @@ -9,7 +9,8 @@ struct wlr_headless_backend { struct wlr_backend backend; - struct wlr_egl egl; + struct wlr_egl priv_egl; // may be uninitialized + struct wlr_egl *egl; struct wlr_renderer *renderer; struct wl_display *display; struct wl_list outputs; diff --git a/include/wlr/backend/headless.h b/include/wlr/backend/headless.h index eab102e2..f9481228 100644 --- a/include/wlr/backend/headless.h +++ b/include/wlr/backend/headless.h @@ -19,6 +19,11 @@ */ struct wlr_backend *wlr_headless_backend_create(struct wl_display *display, wlr_renderer_create_func_t create_renderer_func); +/** + * Creates a headless backend with an existing renderer. + */ +struct wlr_backend *wlr_headless_backend_create_with_renderer( + struct wl_display *display, struct wlr_renderer *renderer); /** * Create a new headless output backed by an in-memory EGL framebuffer. You can * read pixels from this framebuffer via wlr_renderer_read_pixels but it is -- cgit v1.2.3