screencopy_v1: Use new renderer API for gpu blit path

This commit is contained in:
Alexander Orzechowski 2023-06-19 14:30:08 -04:00 committed by Simon Ser
parent c74f89d4f8
commit b4cbaa4549

View file

@ -240,20 +240,20 @@ static bool frame_dma_copy(struct wlr_screencopy_frame_v1 *frame,
return false; return false;
} }
float mat[9];
wlr_matrix_identity(mat);
wlr_matrix_scale(mat, dst_buffer->width, dst_buffer->height);
bool ok = false; 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; goto out;
} }
wlr_renderer_clear(renderer, (float[]){ 0.0, 0.0, 0.0, 0.0 }); wlr_render_pass_add_texture(pass, &(struct wlr_render_texture_options) {
wlr_render_texture_with_matrix(renderer, src_tex, mat, 1.0f); .texture = src_tex,
.blend_mode = WLR_RENDER_BLEND_MODE_NONE,
});
ok = true; ok = wlr_render_pass_submit(pass);
wlr_renderer_end(renderer);
out: out:
wlr_texture_destroy(src_tex); wlr_texture_destroy(src_tex);