mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
render: subtract current frame’s damage when there’s no scroll damage
When re-applying the previous frame’s damage (due to us being forced to double buffer), subtract the current frame’s damage from the region-to-copy when there’s no scroll damage on the current frame. When the current frame doesn’t have any scroll damage, the current frame’s damage is in the same coordinate system as the previous frame’s damage, and we can safely remove it from the region we copy from.
This commit is contained in:
parent
15bfeea745
commit
a1d2044d75
1 changed files with 6 additions and 10 deletions
16
render.c
16
render.c
|
|
@ -2099,7 +2099,6 @@ grid_render(struct terminal *term)
|
|||
tll_free(term->render.last_buf->scroll_damage);
|
||||
#else
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* TODO: remove this frame’s damage from the region we
|
||||
* copy from the old frame.
|
||||
|
|
@ -2138,7 +2137,7 @@ grid_render(struct terminal *term)
|
|||
term->cell_height);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
tll_foreach(term->render.last_buf->scroll_damage, it) {
|
||||
switch (it->item.type) {
|
||||
case DAMAGE_SCROLL:
|
||||
|
|
@ -2163,21 +2162,18 @@ grid_render(struct terminal *term)
|
|||
tll_remove(term->render.last_buf->scroll_damage, it);
|
||||
}
|
||||
|
||||
#if 0
|
||||
pixman_region32_subtract(&dirty, &term->render.last_buf->dirty, &dirty);
|
||||
pixman_image_set_clip_region32(buf->pix[0], &dirty);
|
||||
#else
|
||||
pixman_image_set_clip_region32(buf->pix[0], &term->render.last_buf->dirty);
|
||||
#endif
|
||||
if (tll_length(term->grid->scroll_damage) == 0) {
|
||||
pixman_region32_subtract(&dirty, &term->render.last_buf->dirty, &dirty);
|
||||
pixman_image_set_clip_region32(buf->pix[0], &dirty);
|
||||
} else
|
||||
pixman_image_set_clip_region32(buf->pix[0], &term->render.last_buf->dirty);
|
||||
|
||||
pixman_image_composite32(
|
||||
PIXMAN_OP_SRC, term->render.last_buf->pix[0], NULL, buf->pix[0],
|
||||
0, 0, 0, 0, 0, 0, term->width, term->height);
|
||||
|
||||
pixman_image_set_clip_region32(buf->pix[0], NULL);
|
||||
#if 0
|
||||
pixman_region32_fini(&dirty);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue