Commit 80eea7dd75 for qemu.org
commit 80eea7dd755a32c7e628116979a789e37c529435
Author: Marc-André Lureau <marcandre.lureau@redhat.com>
Date: Thu Feb 19 11:40:34 2026 +0100
ui/console-vc: vga_putcharxy()->vt100_putcharxy()
Have the character rendering function operate on QemuVT100 directly
instead of taking a QemuConsole and extracting the VT100 state
internally. This decouples glyph rendering from the console object,
continuing the QemuVT100 abstraction introduced in the previous commits.
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 272240712a..3d73bdf298 100644
--- a/ui/console-vc.c
+++ b/ui/console-vc.c
@@ -154,14 +154,13 @@ static void image_bitblt(pixman_image_t *image,
xs, ys, 0, 0, xd, yd, w, h);
}
-static void vga_putcharxy(QemuConsole *s, int x, int y, int ch,
- TextAttributes *t_attrib)
+static void vt100_putcharxy(QemuVT100 *vt, int x, int y, int ch,
+ TextAttributes *t_attrib)
{
static pixman_image_t *glyphs[256];
- pixman_image_t *image = QEMU_TEXT_CONSOLE(s)->vt.image;
pixman_color_t fgcol, bgcol;
- assert(image);
+ assert(vt->image);
if (t_attrib->invers) {
bgcol = color_table_rgb[t_attrib->bold][t_attrib->fgcol];
fgcol = color_table_rgb[t_attrib->bold][t_attrib->bgcol];
@@ -173,7 +172,7 @@ static void vga_putcharxy(QemuConsole *s, int x, int y, int ch,
if (!glyphs[ch]) {
glyphs[ch] = qemu_pixman_glyph_from_vgafont(FONT_HEIGHT, vgafont16, ch);
}
- qemu_pixman_glyph_render(glyphs[ch], image,
+ qemu_pixman_glyph_render(glyphs[ch], vt->image,
&fgcol, &bgcol, x, y, FONT_WIDTH, FONT_HEIGHT);
}
@@ -216,9 +215,9 @@ static void console_show_cursor(QemuTextConsole *s, int show)
if (show && cursor_visible_phase) {
TextAttributes t_attrib = TEXT_ATTRIBUTES_DEFAULT;
t_attrib.invers = !(t_attrib.invers); /* invert fg and bg */
- vga_putcharxy(QEMU_CONSOLE(s), x, y, c->ch, &t_attrib);
+ vt100_putcharxy(&s->vt, x, y, c->ch, &t_attrib);
} else {
- vga_putcharxy(QEMU_CONSOLE(s), x, y, c->ch, &(c->t_attrib));
+ vt100_putcharxy(&s->vt, x, y, c->ch, &(c->t_attrib));
}
invalidate_xy(s, x, y);
}
@@ -244,7 +243,7 @@ static void console_refresh(QemuTextConsole *s)
for (y = 0; y < vt->height; y++) {
c = vt->cells + y1 * vt->width;
for (x = 0; x < vt->width; x++) {
- vga_putcharxy(QEMU_CONSOLE(s), x, y, c->ch,
+ vt100_putcharxy(vt, x, y, c->ch,
&(c->t_attrib));
c++;
}
@@ -590,7 +589,7 @@ static void vc_update_xy(VCChardev *vc, int x, int y)
x = vt->width - 1;
}
c = &vt->cells[y1 * vt->width + x];
- vga_putcharxy(QEMU_CONSOLE(s), x, y2, c->ch,
+ vt100_putcharxy(vt, x, y2, c->ch,
&(c->t_attrib));
invalidate_xy(s, x, y2);
}