diff options
author | Alexander Orzechowski <alex@ozal.ski> | 2023-06-19 14:30:08 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-08-12 10:16:51 +0000 |
commit | b4cbaa4549ada0eb009c9f5299a8bbc9917dc00e (patch) | |
tree | 4a13a5cb6706518a7f966054ab53cf940c4f2297 | |
parent | c74f89d4f84bfed0284d3908aee5d207698c70c5 (diff) |
screencopy_v1: Use new renderer API for gpu blit path
-rw-r--r-- | types/wlr_screencopy_v1.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/types/wlr_screencopy_v1.c b/types/wlr_screencopy_v1.c index 23f78d7e..ceb3c686 100644 --- a/types/wlr_screencopy_v1.c +++ b/types/wlr_screencopy_v1.c @@ -240,20 +240,20 @@ static bool frame_dma_copy(struct wlr_screencopy_frame_v1 *frame, return false; } - float mat[9]; - wlr_matrix_identity(mat); - wlr_matrix_scale(mat, dst_buffer->width, dst_buffer->height); - bool ok = false; - if (!wlr_renderer_begin_with_buffer(renderer, dst_buffer)) { + + struct wlr_render_pass *pass = + wlr_renderer_begin_buffer_pass(renderer, dst_buffer, NULL); + if (!pass) { goto out; } - 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_render_pass_add_texture(pass, &(struct wlr_render_texture_options) { + .texture = src_tex, + .blend_mode = WLR_RENDER_BLEND_MODE_NONE, + }); - ok = true; - wlr_renderer_end(renderer); + ok = wlr_render_pass_submit(pass); out: wlr_texture_destroy(src_tex); |