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).
This commit is contained in:
Daniel Eklöf 2019-06-19 14:17:43 +02:00
parent 10765687db
commit 304f15d696
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 269 additions and 89 deletions

3
grid.h
View file

@ -2,6 +2,9 @@
#include "terminal.h"
void grid_damage_update(struct grid *grid, int start, int length);
void grid_damage_erase(struct grid *grid, int start, int length);
void grid_erase(struct grid *grid, int start, int end);
void grid_cursor_to(struct grid *grid, int row, int col);