diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-05-25 08:38:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-25 08:38:44 -0400 |
commit | 35b31dcfb7f54c08301c4eb352325bb852b1bece (patch) | |
tree | 93d550e437722bdeabca5605ada5c0b4d41128cf /render | |
parent | a0eb37e2ea4ad96b4f6e98fddbc5c31d0bd0f293 (diff) | |
parent | 24cf70ae9691d605e4a1f7e9d8dc59ec72401bd0 (diff) |
Merge pull request #1000 from ammen99/custom-renderer-initialization
[RFC] backends: implement custom EGL and renderer initialization
Diffstat (limited to 'render')
-rw-r--r-- | render/wlr_renderer.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c index 8d1bd9ce..39006b58 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" @@ -179,3 +180,19 @@ void wlr_renderer_init_wl_shm(struct wlr_renderer *r, } } } + +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; +} |