From 04c7c42969047283ebba75b4ee59fb5db47de1b0 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 20 Jul 2009 16:46:36 +0000 Subject: [PATCH] 2009-07-20 Joe Auricchio * term/gfxterm.c (grub_virtual_screen_setup): Clear virtual_screen. --- ChangeLog | 4 ++++ term/gfxterm.c | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3a9ed7072..c9616e25c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-07-20 Joe Auricchio + + * term/gfxterm.c (grub_virtual_screen_setup): Clear virtual_screen. + 2009-07-20 Pavel Roskin * configure.ac: Trim excessively wordy excuses. diff --git a/term/gfxterm.c b/term/gfxterm.c index ef93bb70f..61cf0e750 100644 --- a/term/gfxterm.c +++ b/term/gfxterm.c @@ -170,6 +170,8 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y, unsigned int width, unsigned int height, const char *font_name) { + unsigned int i; + /* Free old virtual screen. */ grub_virtual_screen_free (); @@ -225,6 +227,16 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y, grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY); + /* Clear out text buffer. */ + for(i = 0; i < virtual_screen.columns * virtual_screen.rows; i++) + { + virtual_screen.text_buffer[i].code = ' '; + virtual_screen.text_buffer[i].fg_color = virtual_screen.fg_color; + virtual_screen.text_buffer[i].bg_color = virtual_screen.bg_color; + virtual_screen.text_buffer[i].width = 0; + virtual_screen.text_buffer[i].index = 0; + } + return grub_errno; }