diff options
author | Simon Ser <contact@emersion.fr> | 2021-06-08 09:15:55 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-06-09 10:26:09 +0200 |
commit | c87c849ec6a166ea7472c5c87d02646dfc7151b4 (patch) | |
tree | 7d6a129262d83c6c759675c95e3ec90149ad493f | |
parent | fbadadf36f4ef0c2c0834cd7971fcf7bc4562465 (diff) |
backend/x11: use wlr_renderer_begin_with_buffer for cursor
-rw-r--r-- | backend/x11/output.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/backend/x11/output.c b/backend/x11/output.c index 835df3b7..440e26de 100644 --- a/backend/x11/output.c +++ b/backend/x11/output.c @@ -16,11 +16,11 @@ #include <wlr/interfaces/wlr_output.h> #include <wlr/interfaces/wlr_pointer.h> #include <wlr/interfaces/wlr_touch.h> +#include <wlr/render/wlr_renderer.h> #include <wlr/types/wlr_matrix.h> #include <wlr/util/log.h> #include "backend/x11.h" -#include "render/wlr_renderer.h" #include "types/wlr_buffer.h" #include "util/signal.h" #include "util/time.h" @@ -390,12 +390,13 @@ static bool output_cursor_to_picture(struct wlr_x11_output *output, int depth = 32; int stride = buffer->width * 4; - if (!wlr_renderer_bind_buffer(renderer, buffer)) { + uint8_t *data = malloc(buffer->height * stride); + if (data == NULL) { return false; } - uint8_t *data = malloc(buffer->height * stride); - if (data == NULL) { + if (!wlr_renderer_begin_with_buffer(renderer, buffer)) { + free(data); return false; } @@ -404,7 +405,7 @@ static bool output_cursor_to_picture(struct wlr_x11_output *output, stride, buffer->width, buffer->height, 0, 0, 0, 0, data); - wlr_renderer_bind_buffer(renderer, NULL); + wlr_renderer_end(renderer); if (!result) { free(data); |