shm: clear buffer’s dirty region before returning a cached buffer

A non-busy buffer should always have an empty dirty region
This commit is contained in:
Daniel Eklöf 2021-05-10 17:49:15 +02:00
parent 37bbf44f6d
commit 945a346596
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 1 additions and 2 deletions

View file

@ -2290,8 +2290,6 @@ grid_render(struct terminal *term)
xassert(tll_length(term->render.workers.queue) == 0);
}
pixman_region32_clear(&buf->dirty);
int first_dirty_row = -1;
for (int r = 0; r < term->rows; r++) {
struct row *row = grid_row_in_view(term->grid, r);

1
shm.c
View file

@ -250,6 +250,7 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie,
cookie, (void *)&it->item);
it->item.busy = true;
it->item.purge = false;
pixman_region32_clear(&it->item.dirty);
free(it->item.scroll_damage);
it->item.scroll_damage = NULL;
xassert(it->item.pix_instances == pix_instances);