mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-05 01:40:41 -05:00
render: add a 'clean' bit to each cell; only render cells that aren't clean
This patch takes a bit from the foreground color value in a cell (todo: split up foreground/background into bitfields with a separate field for 'foreground/background' has been set), and only re-renders cells that aren't marked as clean. Note: we use a 'clean' bit rather than a 'dirty' bit to make it easy to erase cells - we can (keep doing) do that by simply memsetting a cell range to 0.
This commit is contained in:
parent
c531795b83
commit
85ef9df586
7 changed files with 52 additions and 33 deletions
10
vt.c
10
vt.c
|
|
@ -698,7 +698,6 @@ pre_print(struct terminal *term)
|
|||
static inline void
|
||||
post_print(struct terminal *term)
|
||||
{
|
||||
term->grid->cur_row->dirty = true;
|
||||
if (term->cursor.col < term->cols - 1)
|
||||
term_cursor_right(term, 1);
|
||||
else
|
||||
|
|
@ -716,13 +715,6 @@ print_insert(struct terminal *term)
|
|||
&row[term->cursor.col + 1],
|
||||
&row[term->cursor.col],
|
||||
term->cols - term->cursor.col - 1);
|
||||
|
||||
#if 0
|
||||
term_damage_update(
|
||||
term, term->cursor.linear + 1, term->cols - term->cursor.col - 1);
|
||||
#else
|
||||
row->dirty = true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -737,6 +729,7 @@ action_print_utf8(struct terminal *term)
|
|||
term_damage_update(term, term->cursor.linear, 1);
|
||||
#else
|
||||
row->dirty = true;
|
||||
cell->attrs.clean = 0;
|
||||
#endif
|
||||
|
||||
print_insert(term);
|
||||
|
|
@ -761,6 +754,7 @@ action_print(struct terminal *term, uint8_t c)
|
|||
term_damage_update(term, term->cursor.linear, 1);
|
||||
#else
|
||||
row->dirty = true;
|
||||
cell->attrs.clean = 0;
|
||||
#endif
|
||||
|
||||
print_insert(term);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue