From 85ef9df586dfca22d16d04c9777dc38ff896223a Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 30 Jul 2019 18:03:03 +0200 Subject: 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. --- terminal.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index de359576..3d2bbf72 100644 --- a/terminal.h +++ b/terminal.h @@ -65,8 +65,11 @@ struct attributes { uint8_t conceal:1; uint8_t reverse:1; - uint32_t foreground; - uint32_t background; + uint32_t clean:1; + uint32_t foreground:31; + + uint32_t reserved:1; + uint32_t background:31; } __attribute__((packed)); struct cell { -- cgit v1.3