From 4fa90b05119720a67ccb63cd89246abdb4abf4ea Mon Sep 17 00:00:00 2001 From: emersion Date: Tue, 23 Jan 2018 22:06:54 +0100 Subject: Backport screenshooter fixes from the renderer redesign v1 This backports some changes to #319 to fix the screenshooter data format. This also adds wlr_backend_get_renderer which will be useful to support multiple renderers. --- backend/multi/backend.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'backend/multi/backend.c') diff --git a/backend/multi/backend.c b/backend/multi/backend.c index de6035f8..1e574475 100644 --- a/backend/multi/backend.c +++ b/backend/multi/backend.c @@ -62,10 +62,24 @@ static struct wlr_egl *multi_backend_get_egl(struct wlr_backend *wlr_backend) { return NULL; } +static struct wlr_renderer *multi_backend_get_renderer( + struct wlr_backend *backend) { + struct wlr_multi_backend *multi = (struct wlr_multi_backend *)backend; + struct subbackend_state *sub; + wl_list_for_each(sub, &multi->backends, link) { + struct wlr_renderer *rend = wlr_backend_get_renderer(sub->backend); + if (rend != NULL) { + return rend; + } + } + return NULL; +} + struct wlr_backend_impl backend_impl = { .start = multi_backend_start, .destroy = multi_backend_destroy, .get_egl = multi_backend_get_egl, + .get_renderer = multi_backend_get_renderer, }; static void handle_display_destroy(struct wl_listener *listener, void *data) { -- cgit v1.2.3