mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-02 03:45:58 +01:00
screencopy_v1: Use new renderer API for gpu blit path
This commit is contained in:
parent
c74f89d4f8
commit
b4cbaa4549
1 changed files with 9 additions and 9 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue