diff options
author | emersion <contact@emersion.fr> | 2018-01-29 23:24:09 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-01-29 23:24:09 +0100 |
commit | 51c22d39a4a1a3c4ecfe39ee3df90ba7e66633af (patch) | |
tree | b9fd9fd6fddc8a869f3500bf92944b47c01c578c /backend/headless | |
parent | 2cc989e09716eed5974dc9a76b7b6dbee9c3d730 (diff) | |
parent | ed5b1fdedd775a7acec3d6814cc2ac007e34fd29 (diff) |
Merge remote-tracking branch 'upstream/master' into output-damage
Diffstat (limited to 'backend/headless')
-rw-r--r-- | backend/headless/backend.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/backend/headless/backend.c b/backend/headless/backend.c index cef8eec4..61409d41 100644 --- a/backend/headless/backend.c +++ b/backend/headless/backend.c @@ -1,6 +1,6 @@ #include <stdlib.h> -#include <EGL/egl.h> -#include <EGL/eglext.h> +#include <wlr/render/egl.h> +#include <wlr/render/gles2.h> #include <wlr/util/log.h> #include <wlr/interfaces/wlr_output.h> #include <wlr/interfaces/wlr_input_device.h> @@ -61,10 +61,18 @@ static struct wlr_egl *backend_get_egl(struct wlr_backend *wlr_backend) { return &backend->egl; } +static struct wlr_renderer *backend_get_renderer( + struct wlr_backend *wlr_backend) { + struct wlr_headless_backend *backend = + (struct wlr_headless_backend *)wlr_backend; + return backend->renderer; +} + static const struct wlr_backend_impl backend_impl = { .start = backend_start, .destroy = backend_destroy, .get_egl = backend_get_egl, + .get_renderer = backend_get_renderer, }; static void handle_display_destroy(struct wl_listener *listener, void *data) { @@ -103,6 +111,11 @@ struct wlr_backend *wlr_headless_backend_create(struct wl_display *display) { return NULL; } + backend->renderer = wlr_gles2_renderer_create(&backend->backend); + if (backend->renderer == NULL) { + wlr_log(L_ERROR, "Failed to create renderer"); + } + backend->display_destroy.notify = handle_display_destroy; wl_display_add_destroy_listener(display, &backend->display_destroy); |