aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-30 16:08:27 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-30 16:08:27 +0000
commitf39d848368a7a91c8956979a543293813617ea78 (patch)
tree61b58a6235a7c74371654e7d20f55ae7f6fababa /terminal.c
parentMerge branch 'use-freetype-to-render-glyphs' (diff)
parentmain: pty buffers appear to be ~20KB on modern linux kernels (diff)
Merge branch 'multithreaded-renderer'
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/terminal.c b/terminal.c
index 871e6dcb..d6742259 100644
--- a/terminal.c
+++ b/terminal.c
@@ -20,29 +20,36 @@ void
term_damage_rows(struct terminal *term, int start, int end)
{
assert(start <= end);
- for (int r = start; r <= end; r++)
- grid_row(term->grid, r)->dirty = true;
+ for (int r = start; r <= end; r++) {
+ struct row *row = grid_row(term->grid, r);
+ row->dirty = true;
+ for (int c = 0; c < term->grid->num_cols; c++)
+ row->cells[c].attrs.clean = 0;
+ }
}
void
term_damage_rows_in_view(struct terminal *term, int start, int end)
{
assert(start <= end);
- for (int r = start; r <= end; r++)
- grid_row_in_view(term->grid, r)->dirty = true;
+ for (int r = start; r <= end; r++) {
+ struct row *row = grid_row_in_view(term->grid, r);
+ row->dirty = true;
+ for (int c = 0; c < term->grid->num_cols; c++)
+ row->cells[c].attrs.clean = 0;
+ }
}
void
term_damage_all(struct terminal *term)
{
- term_damage_rows(term, 0, term->rows);
+ term_damage_rows(term, 0, term->rows - 1);
}
void
term_damage_view(struct terminal *term)
{
- for (int i = 0; i < term->rows; i++)
- grid_row_in_view(term->grid, i)->dirty = true;
+ term_damage_rows_in_view(term, 0, term->rows - 1);
}
void
@@ -73,9 +80,10 @@ erase_cell_range(struct terminal *term, struct row *row, int start, int end)
assert(start < term->cols);
assert(end < term->cols);
- if (unlikely(term->vt.attrs.background >> 31)) {
+ if (unlikely(term->vt.attrs.background >> 30)) {
for (int col = start; col <= end; col++) {
row->cells[col].c[0] = '\0';
+ row->cells[col].attrs.clean = 0;
row->cells[col].attrs.background = term->vt.attrs.background;
}
} else {