diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2024-09-20 15:14:59 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2024-09-21 07:11:07 +0000 |
| commit | 798b44934fe36e7fcd738e4395df70fed9246b35 (patch) | |
| tree | a3a42de3be3d1ab869eac53db24e27c7da11aae7 /render.c | |
| parent | render: (debug): assert row->dirty vs. cell->attrs.clean consistency (diff) | |
render: double-buffer: optimization: skip clean rows
When scanning the grid for all-dirty rows (that we can remove from the
damage region we're about to memcpy from the old frame), check the
row->dirty bit, and skip scanning the cells of that row altogether.
We're only looking for rows where all cells are dirty - those rows can
be removed from the region we copy from the old frame, since the
entire row will be re-rendered anyway.
If a row is clean, it *must* be copied from the old frame.
Diffstat (limited to 'render.c')
| -rw-r--r-- | render.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -3046,6 +3046,11 @@ reapply_old_damage(struct terminal *term, struct buffer *new, struct buffer *old for (int r = 0; r < term->rows; r++) { const struct row *row = grid_row_in_view(term->grid, r); + if (!row->dirty) { + full_repaint_needed = false; + continue; + } + bool row_all_dirty = true; for (int c = 0; c < term->cols; c++) { if (row->cells[c].attrs.clean) { |
