aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--types/wlr_screencopy_v1.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/types/wlr_screencopy_v1.c b/types/wlr_screencopy_v1.c
index 2aad103f..ba55bbe2 100644
--- a/types/wlr_screencopy_v1.c
+++ b/types/wlr_screencopy_v1.c
@@ -9,7 +9,6 @@
#include <wlr/backend.h>
#include <wlr/util/log.h>
#include "wlr-screencopy-unstable-v1-protocol.h"
-#include "render/wlr_renderer.h"
#include "render/pixel_format.h"
#include "util/signal.h"
@@ -273,26 +272,24 @@ static bool blit_dmabuf(struct wlr_renderer *renderer,
goto error_src_tex;
}
- if (!wlr_renderer_bind_buffer(renderer, dst_buffer)) {
- goto error_bind_buffer;
- }
-
float mat[9];
wlr_matrix_identity(mat);
wlr_matrix_scale(mat, dst_buffer->width, dst_buffer->height);
- wlr_renderer_begin(renderer, dst_buffer->width, dst_buffer->height);
+ if (!wlr_renderer_begin_with_buffer(renderer, dst_buffer)) {
+ goto error_renderer_begin;
+ }
+
wlr_renderer_clear(renderer, (float[]){ 0.0, 0.0, 0.0, 0.0 });
wlr_render_texture_with_matrix(renderer, src_tex, mat, 1.0f);
- wlr_renderer_end(renderer);
- wlr_renderer_bind_buffer(renderer, NULL);
+ wlr_renderer_end(renderer);
wlr_texture_destroy(src_tex);
wlr_buffer_unlock(dst_buffer);
return true;
-error_bind_buffer:
+error_renderer_begin:
wlr_texture_destroy(src_tex);
error_src_tex:
wlr_buffer_unlock(dst_buffer);