mirror of
git://git.proxmox.com/git/spiceterm.git
synced 2024-12-22 13:34:06 +03:00
iimplement efficient clear screen
This commit is contained in:
parent
37c2d30fb2
commit
e420a6d91d
28
spiceterm.c
28
spiceterm.c
@ -203,6 +203,28 @@ spiceterm_refresh(spiceTerm *vt)
|
|||||||
spiceterm_show_cursor(vt, 1);
|
spiceterm_show_cursor(vt, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
spiceterm_clear_screen(spiceTerm *vt)
|
||||||
|
{
|
||||||
|
int x, y;
|
||||||
|
|
||||||
|
for (y = 0; y <= vt->height; y++) {
|
||||||
|
int y1 = (vt->y_base + y) % vt->total_height;
|
||||||
|
TextCell *c = &vt->cells[y1 * vt->width];
|
||||||
|
for (x = 0; x < vt->width; x++) {
|
||||||
|
c->ch = ' ';
|
||||||
|
c->attrib = vt->default_attrib;
|
||||||
|
c->attrib.fgcol = vt->cur_attrib.fgcol;
|
||||||
|
c->attrib.bgcol = vt->cur_attrib.bgcol;
|
||||||
|
|
||||||
|
c++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spice_screen_clear(vt->screen, 0, 0, vt->screen->primary_width,
|
||||||
|
vt->screen->primary_height);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
spiceterm_unselect_all(spiceTerm *vt)
|
spiceterm_unselect_all(spiceTerm *vt)
|
||||||
{
|
{
|
||||||
@ -922,11 +944,7 @@ spiceterm_putchar(spiceTerm *vt, gunichar2 ch)
|
|||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
/* clear entire screen */
|
/* clear entire screen */
|
||||||
for (y = 0; y <= vt->height; y++) {
|
spiceterm_clear_screen(vt);
|
||||||
for (x = 0; x < vt->width; x++) {
|
|
||||||
spiceterm_clear_xy(vt, x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user