diff options
Diffstat (limited to 'render')
-rw-r--r-- | render/egl.c | 4 | ||||
-rw-r--r-- | render/wlr_renderer.c | 17 |
2 files changed, 19 insertions, 2 deletions
diff --git a/render/egl.c b/render/egl.c index a1452e9d..579bb5fe 100644 --- a/render/egl.c +++ b/render/egl.c @@ -198,8 +198,8 @@ void wlr_egl_finish(struct wlr_egl *egl) { return; } - eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - if (egl->wl_display && eglUnbindWaylandDisplayWL) { + eglMakeCurrent(egl->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + if (egl->wl_display && egl->egl_exts.bind_wayland_display) { eglUnbindWaylandDisplayWL(egl->display, egl->wl_display); } diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index 6407e1ec..aed821c9 100644 --- a/render/wlr_renderer.c +++ b/render/wlr_renderer.c @@ -4,6 +4,7 @@ #include <wlr/render/interface.h> #include <wlr/render/wlr_renderer.h> #include <wlr/types/wlr_matrix.h> +#include <wlr/render/gles2.h> #include <wlr/util/log.h> #include "util/signal.h" @@ -184,3 +185,19 @@ void wlr_renderer_init_wl_display(struct wlr_renderer *r, r->impl->init_wl_display(r, wl_display); } } + +struct wlr_renderer *wlr_renderer_autocreate(struct wlr_egl *egl, + EGLenum platform, void *remote_display, EGLint *config_attribs, EGLint visual_id) { + + if (!wlr_egl_init(egl, platform, remote_display, config_attribs, visual_id)) { + wlr_log(L_ERROR, "Could not initialize EGL"); + return NULL; + } + + struct wlr_renderer *renderer = wlr_gles2_renderer_create(egl); + if (!renderer) { + wlr_egl_finish(egl); + } + + return renderer; +} |