From ff9b3e5cd7206ecfb76c5b595405a2c3970c43f9 Mon Sep 17 00:00:00 2001 From: Michael Grant Date: Mon, 3 Aug 2026 13:14:04 +0100 Subject: [PATCH] Rename image damage functions to redraw --- image.c | 14 +++++++------- screen-write.c | 36 ++++++++++++++++++------------------ tmux.h | 6 +++--- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/image.c b/image.c index cdd081e9c..7285f12bc 100644 --- a/image.c +++ b/image.c @@ -463,7 +463,7 @@ image_clear(struct screen_write_ctx *ctx, u_int id) if (im != NULL && (id == 0 || gc.image_id == id || im->source_id == id)) { if (y >= gd->hsize) - image_damage_area(ctx, x, y - gd->hsize, + image_redraw_area(ctx, x, y - gd->hsize, 1, 1); grid_set_cell(gd, x, y, &grid_default_cell); } @@ -499,7 +499,7 @@ image_check_area(struct screen *s, u_int px, u_int py, u_int nx, u_int ny) } void -image_damage_area(struct screen_write_ctx *ctx, u_int px, u_int py, u_int nx, +image_redraw_area(struct screen_write_ctx *ctx, u_int px, u_int py, u_int nx, u_int ny) { if (ctx->wp != NULL && image_check_area(ctx->s, px, py, nx, ny)) @@ -507,16 +507,16 @@ image_damage_area(struct screen_write_ctx *ctx, u_int px, u_int py, u_int nx, } void -image_damage_all(struct screen_write_ctx *ctx) +image_redraw_all(struct screen_write_ctx *ctx) { - image_damage_area(ctx, 0, 0, screen_size_x(ctx->s), + image_redraw_area(ctx, 0, 0, screen_size_x(ctx->s), screen_size_y(ctx->s)); } void -image_damage_scroll(struct screen_write_ctx *ctx, __unused u_int lines) +image_redraw_scroll(struct screen_write_ctx *ctx, __unused u_int lines) { - image_damage_all(ctx); + image_redraw_all(ctx); } /* Draw the graphical image marker runs in one visible scene span. */ @@ -605,6 +605,6 @@ image_write(struct screen_write_ctx *ctx, struct image *im, u_int bg) grid_view_set_cell(gd, cx + x, cy + y, &gc); } } - image_damage_area(ctx, cx, cy, sx, sy); + image_redraw_area(ctx, cx, cy, sx, sy); screen_write_cursormove(ctx, 0, cy + sy, 0); } diff --git a/screen-write.c b/screen-write.c index d574af323..6ad1c418c 100644 --- a/screen-write.c +++ b/screen-write.c @@ -1309,7 +1309,7 @@ screen_write_alignmenttest(struct screen_write_ctx *ctx) utf8_set(&gc.data, 'E'); #ifdef ENABLE_IMAGES - image_damage_all(ctx); + image_redraw_all(ctx); #endif for (yy = 0; yy < screen_size_y(s); yy++) { @@ -1355,7 +1355,7 @@ screen_write_insertcharacter(struct screen_write_ctx *ctx, u_int nx, u_int bg) return; #ifdef ENABLE_IMAGES - image_damage_area(ctx, 0, s->cy, screen_size_x(s), 1); + image_redraw_area(ctx, 0, s->cy, screen_size_x(s), 1); #endif screen_write_initctx(ctx, &ttyctx, 0, 1); @@ -1395,7 +1395,7 @@ screen_write_deletecharacter(struct screen_write_ctx *ctx, u_int nx, u_int bg) return; #ifdef ENABLE_IMAGES - image_damage_area(ctx, 0, s->cy, screen_size_x(s), 1); + image_redraw_area(ctx, 0, s->cy, screen_size_x(s), 1); #endif screen_write_initctx(ctx, &ttyctx, 0, 1); @@ -1435,7 +1435,7 @@ screen_write_clearcharacter(struct screen_write_ctx *ctx, u_int nx, u_int bg) return; #ifdef ENABLE_IMAGES - image_damage_area(ctx, 0, s->cy, screen_size_x(s), 1); + image_redraw_area(ctx, 0, s->cy, screen_size_x(s), 1); #endif screen_write_initctx(ctx, &ttyctx, 0, 1); @@ -1469,7 +1469,7 @@ screen_write_insertline(struct screen_write_ctx *ctx, u_int ny, u_int bg) ny = 1; #ifdef ENABLE_IMAGES - image_damage_area(ctx, 0, s->cy, screen_size_x(s), sy - s->cy); + image_redraw_area(ctx, 0, s->cy, screen_size_x(s), sy - s->cy); #endif if (s->cy < s->rupper || s->cy > s->rlower) { @@ -1536,7 +1536,7 @@ screen_write_deleteline(struct screen_write_ctx *ctx, u_int ny, u_int bg) ny = 1; #ifdef ENABLE_IMAGES - image_damage_area(ctx, 0, s->cy, screen_size_x(s), sy - s->cy); + image_redraw_area(ctx, 0, s->cy, screen_size_x(s), sy - s->cy); #endif if (s->cy < s->rupper || s->cy > s->rlower) { @@ -1608,7 +1608,7 @@ screen_write_clearline(struct screen_write_ctx *ctx, u_int bg) return; #ifdef ENABLE_IMAGES - image_damage_area(ctx, 0, s->cy, screen_size_x(s), 1); + image_redraw_area(ctx, 0, s->cy, screen_size_x(s), 1); #endif flags = gl->flags & GRID_LINE_OSC133_FLAGS; @@ -1646,7 +1646,7 @@ screen_write_clearendofline(struct screen_write_ctx *ctx, u_int bg) return; #ifdef ENABLE_IMAGES - image_damage_area(ctx, 0, s->cy, screen_size_x(s), 1); + image_redraw_area(ctx, 0, s->cy, screen_size_x(s), 1); #endif grid_view_clear(s->grid, s->cx, s->cy, sx - s->cx, 1, bg); @@ -1672,7 +1672,7 @@ screen_write_clearstartofline(struct screen_write_ctx *ctx, u_int bg) } #ifdef ENABLE_IMAGES - image_damage_area(ctx, 0, s->cy, screen_size_x(s), 1); + image_redraw_area(ctx, 0, s->cy, screen_size_x(s), 1); #endif if (s->cx > sx - 1) @@ -1725,7 +1725,7 @@ screen_write_reverseindex(struct screen_write_ctx *ctx, u_int bg) } #ifdef ENABLE_IMAGES - image_damage_all(ctx); + image_redraw_all(ctx); #endif grid_view_scroll_region_down(s->grid, s->rupper, s->rlower, bg); @@ -1797,9 +1797,9 @@ screen_write_linefeed(struct screen_write_ctx *ctx, int wrapped, u_int bg) #ifdef ENABLE_IMAGES if (rlower == screen_size_y(s) - 1) - image_damage_scroll(ctx, 1); + image_redraw_scroll(ctx, 1); else - image_damage_area(ctx, 0, rupper, screen_size_x(s), + image_redraw_area(ctx, 0, rupper, screen_size_x(s), rlower - rupper); #endif @@ -1827,7 +1827,7 @@ screen_write_scrollup(struct screen_write_ctx *ctx, u_int lines, u_int bg) } #ifdef ENABLE_IMAGES - image_damage_scroll(ctx, lines); + image_redraw_scroll(ctx, lines); #endif for (i = 0; i < lines; i++) { @@ -1855,7 +1855,7 @@ screen_write_scrolldown(struct screen_write_ctx *ctx, u_int lines, u_int bg) lines = s->rlower - s->rupper + 1; #ifdef ENABLE_IMAGES - image_damage_all(ctx); + image_redraw_all(ctx); #endif for (i = 0; i < lines; i++) @@ -1895,7 +1895,7 @@ screen_write_clearendofscreen(struct screen_write_ctx *ctx, u_int bg) struct visible_range *ri; #ifdef ENABLE_IMAGES - image_damage_area(ctx, 0, s->cy, screen_size_x(s), sy - s->cy); + image_redraw_area(ctx, 0, s->cy, screen_size_x(s), sy - s->cy); #endif screen_write_initctx(ctx, &ttyctx, 1, 1); @@ -1975,7 +1975,7 @@ screen_write_clearstartofscreen(struct screen_write_ctx *ctx, u_int bg) struct visible_range *ri; #ifdef ENABLE_IMAGES - image_damage_area(ctx, 0, 0, screen_size_x(s), s->cy + 1); + image_redraw_area(ctx, 0, 0, screen_size_x(s), s->cy + 1); #endif screen_write_initctx(ctx, &ttyctx, 1, 1); @@ -2047,7 +2047,7 @@ screen_write_clearscreen(struct screen_write_ctx *ctx, u_int bg) struct visible_range *ri; #ifdef ENABLE_IMAGES - image_damage_all(ctx); + image_redraw_all(ctx); #endif screen_write_initctx(ctx, &ttyctx, 1, 1); @@ -2513,7 +2513,7 @@ screen_write_collect_end(struct screen_write_ctx *ctx) } #ifdef ENABLE_IMAGES - image_damage_area(ctx, s->cx, s->cy, ci->used, 1); + image_redraw_area(ctx, s->cx, s->cy, ci->used, 1); #endif grid_view_set_cells(s->grid, s->cx, s->cy, &ci->gc, cl->data + ci->x, diff --git a/tmux.h b/tmux.h index e9d6f01c1..abda40073 100644 --- a/tmux.h +++ b/tmux.h @@ -4276,10 +4276,10 @@ void image_size_in_cells(u_int, u_int, u_int, u_int, u_int *, u_char *image_base64_decode(const char *, size_t, size_t, size_t *); u_char *image_png_decode(const u_char *, size_t, size_t, u_int *, u_int *); -void image_damage_area(struct screen_write_ctx *, u_int, u_int, +void image_redraw_area(struct screen_write_ctx *, u_int, u_int, u_int, u_int); -void image_damage_all(struct screen_write_ctx *); -void image_damage_scroll(struct screen_write_ctx *, u_int); +void image_redraw_all(struct screen_write_ctx *); +void image_redraw_scroll(struct screen_write_ctx *, u_int); int image_tty_is_graphical(struct tty *); int image_tty_scrolls(struct tty *); void image_tty_update(struct tty *);