Commit 1cce59bb82 for qemu.org
commit 1cce59bb8255171068f2d3d766a927b19e68447d
Author: Marc-André Lureau <marcandre.lureau@redhat.com>
Date: Thu Feb 19 11:57:14 2026 +0100
ui/console-vc: make invalidate_xy() take vt100
This decouples glyph rendering from the console object, continuing the
QemuVT100 abstraction introduced in the previous commits.
Style fixes.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
diff --git a/ui/console-vc.c b/ui/console-vc.c
index 3d73bdf298..34d9101679 100644
--- a/ui/console-vc.c
+++ b/ui/console-vc.c
@@ -176,21 +176,20 @@ static void vt100_putcharxy(QemuVT100 *vt, int x, int y, int ch,
&fgcol, &bgcol, x, y, FONT_WIDTH, FONT_HEIGHT);
}
-static void invalidate_xy(QemuTextConsole *s, int x, int y)
+static void vt100_invalidate_xy(QemuVT100 *vt, int x, int y)
{
- QemuVT100 *vt = &s->vt;
-
- if (!qemu_console_is_visible(QEMU_CONSOLE(s))) {
- return;
- }
- if (vt->update_x0 > x * FONT_WIDTH)
+ if (vt->update_x0 > x * FONT_WIDTH) {
vt->update_x0 = x * FONT_WIDTH;
- if (vt->update_y0 > y * FONT_HEIGHT)
+ }
+ if (vt->update_y0 > y * FONT_HEIGHT) {
vt->update_y0 = y * FONT_HEIGHT;
- if (vt->update_x1 < (x + 1) * FONT_WIDTH)
+ }
+ if (vt->update_x1 < (x + 1) * FONT_WIDTH) {
vt->update_x1 = (x + 1) * FONT_WIDTH;
- if (vt->update_y1 < (y + 1) * FONT_HEIGHT)
+ }
+ if (vt->update_y1 < (y + 1) * FONT_HEIGHT) {
vt->update_y1 = (y + 1) * FONT_HEIGHT;
+ }
}
static void console_show_cursor(QemuTextConsole *s, int show)
@@ -219,7 +218,7 @@ static void console_show_cursor(QemuTextConsole *s, int show)
} else {
vt100_putcharxy(&s->vt, x, y, c->ch, &(c->t_attrib));
}
- invalidate_xy(s, x, y);
+ vt100_invalidate_xy(&s->vt, x, y);
}
}
@@ -591,7 +590,7 @@ static void vc_update_xy(VCChardev *vc, int x, int y)
c = &vt->cells[y1 * vt->width + x];
vt100_putcharxy(vt, x, y2, c->ch,
&(c->t_attrib));
- invalidate_xy(s, x, y2);
+ vt100_invalidate_xy(&s->vt, x, y2);
}
}