* grub-core/term/gfxterm.c (grub_virtual_screen_setup): Use

default_bg_color rather than black.
(grub_gfxterm_fullscreen): Likewise.
(grub_gfxterm_background_color_cmd): Save new background color in
default_bg_color.
This commit is contained in:
Colin Watson 2011-06-28 17:05:41 +01:00
parent 8d5d8444bd
commit 548947916b
2 changed files with 17 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2011-06-28 Colin Watson <cjwatson@ubuntu.com>
* grub-core/term/gfxterm.c (grub_virtual_screen_setup): Use
default_bg_color rather than black.
(grub_gfxterm_fullscreen): Likewise.
(grub_gfxterm_background_color_cmd): Save new background color in
default_bg_color.
2011-06-27 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/Makefile.core.def (chain): Fix coreboot filename.

View file

@ -131,6 +131,7 @@ static unsigned int bitmap_width;
static unsigned int bitmap_height;
static struct grub_video_bitmap *bitmap;
static int blend_text_bg;
static grub_video_rgba_color_t default_bg_color = { 0, 0, 0, 0 };
static struct grub_dirty_region dirty_region;
@ -266,7 +267,8 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y,
grub_video_set_active_render_target (render_target);
virtual_screen.bg_color_display = grub_video_map_rgba(0, 0, 0, 0);
virtual_screen.bg_color_display =
grub_video_map_rgba_color (default_bg_color);
/* Clear out text buffer. */
for (i = 0; i < virtual_screen.columns * virtual_screen.rows; i++)
@ -338,8 +340,8 @@ grub_gfxterm_fullscreen (void)
double_redraw = mode_info.mode_type & GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED
&& !(mode_info.mode_type & GRUB_VIDEO_MODE_TYPE_UPDATING_SWAP);
/* Make sure screen is black. */
color = grub_video_map_rgb (0, 0, 0);
/* Make sure screen is set to the default background color. */
color = grub_video_map_rgba_color (default_bg_color);
grub_video_fill_rect (color, 0, 0, mode_info.width, mode_info.height);
if (double_redraw)
{
@ -1189,7 +1191,6 @@ static grub_err_t
grub_gfxterm_background_color_cmd (grub_command_t cmd __attribute__ ((unused)),
int argc, char **args)
{
grub_video_rgba_color_t color;
struct grub_video_render_target *old_target;
if (argc != 1)
@ -1199,7 +1200,7 @@ grub_gfxterm_background_color_cmd (grub_command_t cmd __attribute__ ((unused)),
if (grub_video_get_info (NULL) != GRUB_ERR_NONE)
return grub_errno;
if (grub_video_parse_color (args[0], &color) != GRUB_ERR_NONE)
if (grub_video_parse_color (args[0], &default_bg_color) != GRUB_ERR_NONE)
return grub_errno;
/* Destroy existing background bitmap if loaded. */
@ -1216,9 +1217,10 @@ grub_gfxterm_background_color_cmd (grub_command_t cmd __attribute__ ((unused)),
compatible with the text layer. */
grub_video_get_active_render_target (&old_target);
grub_video_set_active_render_target (text_layer);
virtual_screen.bg_color = grub_video_map_rgba_color (color);
virtual_screen.bg_color = grub_video_map_rgba_color (default_bg_color);
grub_video_set_active_render_target (old_target);
virtual_screen.bg_color_display = grub_video_map_rgba_color (color);
virtual_screen.bg_color_display =
grub_video_map_rgba_color (default_bg_color);
blend_text_bg = 1;
/* Mark whole screen as dirty. */