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>
Marc-André Lureau committed
Feb 19, 2026 at 11:57 UTC
1cce59bb8255171068f2d3d766a927b19e68447d
1 file changed
+11
-12
ui/console-vc.c
+11
-12
@@ -176,21 +176,20 @@ static void vt100_putcharxy(QemuVT100 *vt, int x, int y, int ch,
176
&fgcol, &bgcol, x, y, FONT_WIDTH, FONT_HEIGHT);
177
}
178
179
-static void invalidate_xy(QemuTextConsole *s, int x, int y)
179
+static void vt100_invalidate_xy(QemuVT100 *vt, int x, int y)
180
{
181
- QemuVT100 *vt = &s->vt;
182
-
183
- if (!qemu_console_is_visible(QEMU_CONSOLE(s))) {
184
- return;
185
- }
186
- if (vt->update_x0 > x * FONT_WIDTH)
181
+ if (vt->update_x0 > x * FONT_WIDTH) {
182
vt->update_x0 = x * FONT_WIDTH;
188
- if (vt->update_y0 > y * FONT_HEIGHT)
183
+ }
184
+ if (vt->update_y0 > y * FONT_HEIGHT) {
185
vt->update_y0 = y * FONT_HEIGHT;
190
- if (vt->update_x1 < (x + 1) * FONT_WIDTH)
186
+ }
187
+ if (vt->update_x1 < (x + 1) * FONT_WIDTH) {
188
vt->update_x1 = (x + 1) * FONT_WIDTH;
192
- if (vt->update_y1 < (y + 1) * FONT_HEIGHT)
189
+ }
190
+ if (vt->update_y1 < (y + 1) * FONT_HEIGHT) {
191
vt->update_y1 = (y + 1) * FONT_HEIGHT;
192
+ }
193
}
194
195
static void console_show_cursor(QemuTextConsole *s, int show)
@@ -219,7 +218,7 @@ static void console_show_cursor(QemuTextConsole *s, int show)
218
} else {
219
vt100_putcharxy(&s->vt, x, y, c->ch, &(c->t_attrib));
220
}
222
- invalidate_xy(s, x, y);
221
+ vt100_invalidate_xy(&s->vt, x, y);
222
}
223
}
224
@@ -591,7 +590,7 @@ static void vc_update_xy(VCChardev *vc, int x, int y)
590
c = &vt->cells[y1 * vt->width + x];
591
vt100_putcharxy(vt, x, y2, c->ch,
592
&(c->t_attrib));
594
- invalidate_xy(s, x, y2);
593
+ vt100_invalidate_xy(&s->vt, x, y2);
594
}
595
}
596