aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-06-08 09:15:17 +0200
committerSimon Ser <contact@emersion.fr>2021-06-09 10:26:09 +0200
commitfbadadf36f4ef0c2c0834cd7971fcf7bc4562465 (patch)
treeda850a28c460c30db3e734ea2af4ed51f1d6b4ba
parenta667175ec7d6f04c7d3a5f8db0bf7c5bed432152 (diff)
output: use wlr_renderer_begin_with_buffer for cursor
-rw-r--r--types/wlr_output.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/types/wlr_output.c b/types/wlr_output.c
index f50189ab..78ad9a6e 100644
--- a/types/wlr_output.c
+++ b/types/wlr_output.c
@@ -1263,11 +1263,6 @@ static struct wlr_buffer *render_cursor_buffer(struct wlr_output_cursor *cursor)
return NULL;
}
- if (!wlr_renderer_bind_buffer(renderer, buffer)) {
- wlr_buffer_unlock(buffer);
- return NULL;
- }
-
struct wlr_box cursor_box = {
.width = texture->width * output->scale / scale,
.height = texture->height * output->scale / scale,
@@ -1292,12 +1287,15 @@ static struct wlr_buffer *render_cursor_buffer(struct wlr_output_cursor *cursor)
float matrix[9];
wlr_matrix_project_box(matrix, &cursor_box, transform, 0, output_matrix);
- wlr_renderer_begin(renderer, width, height);
+ if (!wlr_renderer_begin_with_buffer(renderer, buffer)) {
+ wlr_buffer_unlock(buffer);
+ return NULL;
+ }
+
wlr_renderer_clear(renderer, (float[]){ 0.0, 0.0, 0.0, 0.0 });
wlr_render_texture_with_matrix(renderer, texture, matrix, 1.0);
- wlr_renderer_end(renderer);
- wlr_renderer_bind_buffer(renderer, NULL);
+ wlr_renderer_end(renderer);
return buffer;
}