diff --git a/include/wlr/render/gles2.h b/include/wlr/render/gles2.h index f8ca22bc78..933a969d51 100644 --- a/include/wlr/render/gles2.h +++ b/include/wlr/render/gles2.h @@ -13,11 +13,17 @@ #include #include -struct wlr_egl; +struct wlr_egl_context; struct wlr_renderer *wlr_gles2_renderer_create_with_drm_fd(int drm_fd); -struct wlr_egl *wlr_gles2_renderer_get_egl(struct wlr_renderer *renderer); +/** + * Returns the current EGL context + * The pointer returned is not owned by the caller + */ +struct wlr_egl_context *wlr_gles2_renderer_get_egl_context( + struct wlr_renderer *wlr_renderer); + bool wlr_gles2_renderer_check_ext(struct wlr_renderer *renderer, const char *ext); /** diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c index dcf4535c1b..62aab86202 100644 --- a/render/gles2/renderer.c +++ b/render/gles2/renderer.c @@ -494,10 +494,10 @@ static uint32_t gles2_get_render_buffer_caps(struct wlr_renderer *wlr_renderer) return WLR_BUFFER_CAP_DMABUF; } -struct wlr_egl *wlr_gles2_renderer_get_egl(struct wlr_renderer *wlr_renderer) { - struct wlr_gles2_renderer *renderer = - gles2_get_renderer(wlr_renderer); - return renderer->egl; +struct wlr_egl_context *wlr_gles2_renderer_get_egl_context( + struct wlr_renderer *wlr_renderer) { + struct wlr_gles2_renderer *renderer = gles2_get_renderer(wlr_renderer); + return &renderer->egl->ctx; } static void gles2_destroy(struct wlr_renderer *wlr_renderer) {