From c24351681f672a2ce561b9cb6d73172dfc36c45c Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 10 Aug 2017 22:15:37 -0400 Subject: Refactor EGL handling --- backend/drm/backend.c | 8 +++++++- backend/drm/drm.c | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'backend/drm') diff --git a/backend/drm/backend.c b/backend/drm/backend.c index bcc81624..a7e6824c 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "backend/udev.h" #include "backend/drm.h" @@ -38,9 +39,14 @@ static void wlr_drm_backend_destroy(struct wlr_backend_state *drm) { free(drm); } +static struct wlr_egl *wlr_drm_backend_get_egl(struct wlr_backend_state *drm) { + return &drm->renderer.egl; +} + static struct wlr_backend_impl backend_impl = { .init = wlr_drm_backend_init, - .destroy = wlr_drm_backend_destroy + .destroy = wlr_drm_backend_destroy, + .get_egl = wlr_drm_backend_get_egl }; static void session_signal(struct wl_listener *listener, void *data) { diff --git a/backend/drm/drm.c b/backend/drm/drm.c index e11751e2..927388b0 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -579,7 +579,7 @@ static bool wlr_drm_output_set_cursor(struct wlr_output_state *output, wlr_matrix_texture(plane->matrix, plane->width, plane->height, output->base->transform ^ WL_OUTPUT_TRANSFORM_FLIPPED_180); - plane->wlr_rend = wlr_gles2_renderer_init(&output->renderer->egl); + plane->wlr_rend = wlr_gles2_renderer_init(drm->base); if (!plane->wlr_rend) { return false; } -- cgit v1.2.3