aboutsummaryrefslogtreecommitdiff
path: root/backend/x11
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/x11
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/x11')
-rw-r--r--backend/x11/backend.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/backend/x11/backend.c b/backend/x11/backend.c
index e1622d06..3e450dbd 100644
--- a/backend/x11/backend.c
+++ b/backend/x11/backend.c
@@ -16,6 +16,7 @@
#include <wlr/backend/interface.h>
#include <wlr/backend/x11.h>
#include <wlr/render/egl.h>
+#include <wlr/render/gles2.h>
#include <wlr/interfaces/wlr_output.h>
#include <wlr/interfaces/wlr_input_device.h>
#include <wlr/interfaces/wlr_keyboard.h>
@@ -272,16 +273,23 @@ static struct wlr_egl *wlr_x11_backend_get_egl(struct wlr_backend *backend) {
return &x11->egl;
}
-bool wlr_backend_is_x11(struct wlr_backend *backend) {
- return backend->impl == &backend_impl;
+static struct wlr_renderer *wlr_x11_backend_get_renderer(
+ struct wlr_backend *backend) {
+ struct wlr_x11_backend *x11 = (struct wlr_x11_backend *)backend;
+ return x11->renderer;
}
static struct wlr_backend_impl backend_impl = {
.start = wlr_x11_backend_start,
.destroy = wlr_x11_backend_destroy,
.get_egl = wlr_x11_backend_get_egl,
+ .get_renderer = wlr_x11_backend_get_renderer,
};
+bool wlr_backend_is_x11(struct wlr_backend *backend) {
+ return backend->impl == &backend_impl;
+}
+
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_x11_backend *x11 =
wl_container_of(listener, x11, display_destroy);
@@ -330,6 +338,11 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display,
goto error_event;
}
+ x11->renderer = wlr_gles2_renderer_create(&x11->backend);
+ if (x11->renderer == NULL) {
+ wlr_log(L_ERROR, "Failed to create renderer");
+ }
+
wlr_input_device_init(&x11->keyboard_dev, WLR_INPUT_DEVICE_KEYBOARD,
&input_device_impl, "X11 keyboard", 0, 0);
wlr_keyboard_init(&x11->keyboard, NULL);