aboutsummaryrefslogtreecommitdiff
path: root/backend/headless
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-01-23 22:06:54 +0100
committeremersion <contact@emersion.fr>2018-01-23 22:06:54 +0100
commit4fa90b05119720a67ccb63cd89246abdb4abf4ea (patch)
treeee019624271aca1e4ac9560ffc528d4563c01b52 /backend/headless
parent03440bbd83b5d68404db8ebc2df310ec0f8c9b32 (diff)
Backport screenshooter fixes from the renderer redesign v1
This backports some changes to #319 to fix the screenshooter data format. This also adds wlr_backend_get_renderer which will be useful to support multiple renderers.
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);