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.
This commit is contained in:
Daniel Eklöf 2024-09-20 17:14:59 +02:00
parent a9fefcf58b
commit 798b44934f
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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) {