diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-08-10 22:15:37 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-08-10 22:15:37 -0400 |
commit | c24351681f672a2ce561b9cb6d73172dfc36c45c (patch) | |
tree | 5b39ee3fd871e90cfbf0f0a057d11debc15caf97 /backend/multi | |
parent | 4aaf76cb66865efb8ea902a45596cd12d0f73b8e (diff) |
Refactor EGL handling
Diffstat (limited to 'backend/multi')
-rw-r--r-- | backend/multi/backend.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/backend/multi/backend.c b/backend/multi/backend.c index 19839629..9563356d 100644 --- a/backend/multi/backend.c +++ b/backend/multi/backend.c @@ -38,9 +38,21 @@ static void multi_backend_destroy(struct wlr_backend_state *state) { free(state); } +static struct wlr_egl *multi_backend_get_egl(struct wlr_backend_state *state) { + for (size_t i = 0; i < state->backends->length; ++i) { + struct subbackend_state *sub = state->backends->items[i]; + struct wlr_egl *egl = wlr_backend_get_egl(sub->backend); + if (egl) { + return egl; + } + } + return NULL; +} + struct wlr_backend_impl backend_impl = { .init = multi_backend_init, - .destroy = multi_backend_destroy + .destroy = multi_backend_destroy, + .get_egl = multi_backend_get_egl }; struct wlr_backend *wlr_multi_backend_create(struct wlr_session *session, |