mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
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:
parent
a9fefcf58b
commit
798b44934f
1 changed files with 5 additions and 0 deletions
5
render.c
5
render.c
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue