aboutsummaryrefslogtreecommitdiff
path: root/backend/headless
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-01-29 17:13:23 -0500
committerGitHub <noreply@github.com>2018-01-29 17:13:23 -0500
commited5b1fdedd775a7acec3d6814cc2ac007e34fd29 (patch)
tree79192b14d83eae55d63c38223ba60beb020bb6f6 /backend/headless
parent60b2d969e07e24ed1b96ccc9d82bc2f9c1d540f2 (diff)
parentf34a1b75ebd9dbebf4fb9c2cf34d878fce902c03 (diff)
Merge pull request #580 from emersion/screenshooter-renderer-backport
Backport screenshooter fixes from the renderer redesign v1
Diffstat (limited to 'backend/headless')
-rw-r--r--backend/headless/backend.c17
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);