From 4340f8a3b4c5149825d8f1786cfeb7a3af9c0e51 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 22 Sep 2022 18:34:41 +0200 Subject: render: fix application of old scroll damage when double buffering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- shm.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'shm.c') diff --git a/shm.c b/shm.c index 4c342ddf..4394dbe9 100644 --- a/shm.c +++ b/shm.c @@ -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; } -- cgit v1.3