Merge branch 'buffer-pass-clear' into 'master'

render: optionally clear buffer before rendering

See merge request wlroots/wlroots!4518
This commit is contained in:
Julia Tatz 2024-04-22 06:05:12 +00:00
commit 229f89b416
19 changed files with 254 additions and 118 deletions

View file

@ -312,6 +312,13 @@ static struct wlr_render_pass *pixman_begin_buffer_pass(struct wlr_renderer *wlr
if (pass == NULL) {
return NULL;
}
if (options->clear_buffer) {
wlr_render_pass_add_rect(&pass->base, &(struct wlr_render_rect_options){
.box = { .width = buffer->buffer->width, .height = buffer->buffer->height },
.color = options->clear_color,
.blend_mode = WLR_RENDER_BLEND_MODE_NONE,
});
}
return &pass->base;
}