From 24cf70ae9691d605e4a1f7e9d8dc59ec72401bd0 Mon Sep 17 00:00:00 2001 From: Ilia Bozhinov Date: Fri, 25 May 2018 13:14:35 +0300 Subject: backends: implement custom EGL and renderer initialization Compositors now have more control over how the backend creates its renderer. Currently all backends create an EGL/GLES2 renderer, so the necessary attributes for creating the context are passed to a user-provided callback function. It is responsible for initializing provided wlr_egl and to return a renderer. On fail, return 0. Fixes #987 --- backend/drm/backend.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'backend/drm/backend.c') diff --git a/backend/drm/backend.c b/backend/drm/backend.c index c14b99e3..744a32d2 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -114,7 +114,8 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) { } struct wlr_backend *wlr_drm_backend_create(struct wl_display *display, - struct wlr_session *session, int gpu_fd, struct wlr_backend *parent) { + struct wlr_session *session, int gpu_fd, struct wlr_backend *parent, + wlr_renderer_create_func_t create_renderer_func) { assert(display && session && gpu_fd >= 0); assert(!parent || wlr_backend_is_drm(parent)); @@ -161,7 +162,7 @@ struct wlr_backend *wlr_drm_backend_create(struct wl_display *display, goto error_event; } - if (!init_drm_renderer(drm, &drm->renderer)) { + if (!init_drm_renderer(drm, &drm->renderer, create_renderer_func)) { wlr_log(L_ERROR, "Failed to initialize renderer"); goto error_event; } -- cgit v1.2.3