mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-25 01:40:19 -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
2
grid.c
2
grid.c
|
|
@ -29,6 +29,8 @@ grid_row_alloc(int cols)
|
|||
{
|
||||
struct row *row = malloc(sizeof(*row));
|
||||
row->cells = calloc(cols, sizeof(row->cells[0]));
|
||||
for (size_t c = 0; c < cols; c++)
|
||||
row->cells[c].attrs.clean = 1;
|
||||
row->dirty = false; /* TODO: parameter? */
|
||||
return row;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue