mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
screencopy-v1: simplify frame_dma_copy() error path
Unify success and error code-paths.
This commit is contained in:
parent
0af4affd0b
commit
50cc1ef4d3
1 changed files with 5 additions and 6 deletions
|
@ -248,21 +248,20 @@ static bool frame_dma_copy(struct wlr_screencopy_frame_v1 *frame,
|
||||||
wlr_matrix_identity(mat);
|
wlr_matrix_identity(mat);
|
||||||
wlr_matrix_scale(mat, dst_buffer->width, dst_buffer->height);
|
wlr_matrix_scale(mat, dst_buffer->width, dst_buffer->height);
|
||||||
|
|
||||||
|
bool ok = false;
|
||||||
if (!wlr_renderer_begin_with_buffer(renderer, dst_buffer)) {
|
if (!wlr_renderer_begin_with_buffer(renderer, dst_buffer)) {
|
||||||
goto error_renderer_begin;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
wlr_renderer_clear(renderer, (float[]){ 0.0, 0.0, 0.0, 0.0 });
|
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_texture_with_matrix(renderer, src_tex, mat, 1.0f);
|
||||||
|
|
||||||
|
ok = true;
|
||||||
wlr_renderer_end(renderer);
|
wlr_renderer_end(renderer);
|
||||||
|
|
||||||
|
out:
|
||||||
wlr_texture_destroy(src_tex);
|
wlr_texture_destroy(src_tex);
|
||||||
return true;
|
return ok;
|
||||||
|
|
||||||
error_renderer_begin:
|
|
||||||
wlr_texture_destroy(src_tex);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void frame_handle_output_commit(struct wl_listener *listener,
|
static void frame_handle_output_commit(struct wl_listener *listener,
|
||||||
|
|
Loading…
Reference in a new issue