From 304f15d696ad544bbd90a1e54e547e4e2fbe42c5 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 19 Jun 2019 14:17:43 +0200 Subject: 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). --- vt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'vt.c') 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; } -- cgit v1.3