render: fix application of old scroll damage when double buffering

On compositors that forces us to double buffer, we need to re-apply
the last frame’s damage to the current frame (which uses the buffer
from the next-to-last frame).

General cell updates are handled by simply copying from the last
frame’s pixman buffer to the current frame’s.

In an attempt to improve performance, scroll damage were up until now
handled by re-playing the last frame’s scroll damage (on the current
frame’s buffer). This does not work, and resulted in glitches when
scrolling in the scrollback.

This patch does the following:

* grid_render_scroll{,_reverse}() now update the buffer’s "dirty"
  region. This means the generic copy-old-frames-buffer handles the
  scroll damage (albeit in, potentially, a less efficient way).

* Tracking of, and re-applying old scroll damage is completely
  removed.

Closes #1173
This commit is contained in:
Daniel Eklöf 2022-09-22 18:34:41 +02:00
parent 50ae277d90
commit 4340f8a3b4
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 74 additions and 68 deletions

3
shm.c
View file

@ -151,7 +151,6 @@ buffer_destroy(struct buffer_private *buf)
pool_unref(buf->pool);
buf->pool = NULL;
free(buf->public.scroll_damage);
pixman_region32_fini(&buf->public.dirty);
free(buf);
}
@ -581,8 +580,6 @@ shm_get_buffer(struct buffer_chain *chain, int width, int height)
LOG_DBG("re-using buffer %p from cache", (void *)cached);
cached->busy = true;
pixman_region32_clear(&cached->public.dirty);
free(cached->public.scroll_damage);
cached->public.scroll_damage = NULL;
xassert(cached->public.pix_instances == chain->pix_instances);
return &cached->public;
}