aboutsummaryrefslogtreecommitdiff
path: root/vt.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-06-19 12:17:43 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-06-19 12:17:43 +0000
commit304f15d696ad544bbd90a1e54e547e4e2fbe42c5 (patch)
treedea6898d9f7e7940eb30488777582f90d052f554 /vt.c
parentcsi: dummy implementation of bright foreground/background colors (diff)
Use a 'damage' list to communicate what needs to be updated
Instead of having each cell in the grid track it's own dirtiness, grid operations now append "damage" to a list. This list is consumed every time we render the grid. This allows us to special case some operations, like erase (and in the future, scroll).
Diffstat (limited to 'vt.c')
-rw-r--r--vt.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/vt.c b/vt.c
index bdb9946f..95df06d2 100644
--- a/vt.c
+++ b/vt.c
@@ -200,8 +200,7 @@ action(struct terminal *term, enum action action, uint8_t c)
}
struct cell *cell = &term->grid.cells[term->grid.linear_cursor];
-
- cell->dirty = true;
+ grid_damage_update(&term->grid, term->grid.linear_cursor, 1);
if (term->vt.utf8.idx > 0) {
//LOG_DBG("print: UTF8: %.*s", (int)term->vt.utf8.idx, term->vt.utf8.data);
@@ -209,7 +208,7 @@ action(struct terminal *term, enum action action, uint8_t c)
cell->c[term->vt.utf8.idx] = '\0';
memset(&term->vt.utf8, 0, sizeof(term->vt.utf8));
} else {
- LOG_DBG("print: ASCII: %c", c);
+ //LOG_DBG("print: ASCII: %c", c);
cell->c[0] = c;
cell->c[1] = '\0';
}
@@ -221,7 +220,6 @@ action(struct terminal *term, enum action action, uint8_t c)
else
term->grid.print_needs_wrap = true;
- term->grid.dirty = true;
break;
}