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>
---
ui/console-vc.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/ui/console-vc.c b/ui/console-vc.c
index 9566ce592f2..61d72a0cc27 100644
--- a/ui/console-vc.c
+++ b/ui/console-vc.c
@@ -195,9 +195,8 @@ static void vt100_invalidate_xy(QemuVT100 *vt, int x, int y)
}
}
-static void console_show_cursor(QemuTextConsole *s, int show)
+static void vt100_show_cursor(QemuVT100 *vt, int show)
{
- QemuVT100 *vt = &s->vt;
TextCell *c;
int y, y1;
int x = vt->x;
@@ -217,11 +216,11 @@ 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 */
- vt100_putcharxy(&s->vt, x, y, c->ch, &t_attrib);
+ vt100_putcharxy(vt, x, y, c->ch, &t_attrib);
} else {
- vt100_putcharxy(&s->vt, x, y, c->ch, &(c->t_attrib));
+ vt100_putcharxy(vt, x, y, c->ch, &(c->t_attrib));
}
- vt100_invalidate_xy(&s->vt, x, y);
+ vt100_invalidate_xy(vt, x, y);
}
}
@@ -253,7 +252,7 @@ static void console_refresh(QemuTextConsole *s)
y1 = 0;
}
}
- console_show_cursor(s, 1);
+ vt100_show_cursor(&s->vt, 1);
dpy_gfx_update(QEMU_CONSOLE(s), 0, 0, w, h);
}
@@ -1084,11 +1083,11 @@ static int vc_chr_write(Chardev *chr, const uint8_t *buf, int len)
vt->update_y0 = vt->height * FONT_HEIGHT;
vt->update_x1 = 0;
vt->update_y1 = 0;
- console_show_cursor(s, 0);
+ vt100_show_cursor(vt, 0);
for(i = 0; i < len; i++) {
vc_putchar(drv, buf[i]);
}
- console_show_cursor(s, 1);
+ vt100_show_cursor(vt, 1);
if (vt->update_x0 < vt->update_x1) {
dpy_gfx_update(QEMU_CONSOLE(s), vt->update_x0, vt->update_y0,
vt->update_x1 - vt->update_x0,
--
2.53.0