Refactor EGL handling

This commit is contained in:
Drew DeVault 2017-08-10 22:15:37 -04:00
parent 4aaf76cb66
commit c24351681f
26 changed files with 156 additions and 98 deletions

View file

@ -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,