* term/gfxterm.c (grub_gfxterm_background_image_cmd): Fix
indentation.
This commit is contained in:
parent
0b0f9620f2
commit
f7bf0918aa
2 changed files with 40 additions and 35 deletions
|
@ -1,3 +1,8 @@
|
|||
2010-07-07 Colin Watson <cjwatson@ubuntu.com>
|
||||
|
||||
* term/gfxterm.c (grub_gfxterm_background_image_cmd): Fix
|
||||
indentation.
|
||||
|
||||
2010-07-06 Colin Watson <cjwatson@ubuntu.com>
|
||||
|
||||
* conf/common.rmk (grub_probe_SOURCES): Add disk/raid5_recover.c
|
||||
|
|
|
@ -1134,44 +1134,44 @@ grub_gfxterm_background_image_cmd (grub_extcmd_t cmd __attribute__ ((unused)),
|
|||
/* If filename was provided, try to load that. */
|
||||
if (argc >= 1)
|
||||
{
|
||||
/* Try to load new one. */
|
||||
grub_video_bitmap_load (&bitmap, args[0]);
|
||||
if (grub_errno != GRUB_ERR_NONE)
|
||||
return grub_errno;
|
||||
/* Try to load new one. */
|
||||
grub_video_bitmap_load (&bitmap, args[0]);
|
||||
if (grub_errno != GRUB_ERR_NONE)
|
||||
return grub_errno;
|
||||
|
||||
/* Determine if the bitmap should be scaled to fit the screen. */
|
||||
if (!state[BACKGROUND_CMD_ARGINDEX_MODE].set
|
||||
|| grub_strcmp (state[BACKGROUND_CMD_ARGINDEX_MODE].arg,
|
||||
"stretch") == 0)
|
||||
/* Determine if the bitmap should be scaled to fit the screen. */
|
||||
if (!state[BACKGROUND_CMD_ARGINDEX_MODE].set
|
||||
|| grub_strcmp (state[BACKGROUND_CMD_ARGINDEX_MODE].arg,
|
||||
"stretch") == 0)
|
||||
{
|
||||
if (window.width != grub_video_bitmap_get_width (bitmap)
|
||||
|| window.height != grub_video_bitmap_get_height (bitmap))
|
||||
{
|
||||
struct grub_video_bitmap *scaled_bitmap;
|
||||
grub_video_bitmap_create_scaled (&scaled_bitmap,
|
||||
window.width,
|
||||
window.height,
|
||||
bitmap,
|
||||
GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST);
|
||||
if (grub_errno == GRUB_ERR_NONE)
|
||||
{
|
||||
/* Replace the original bitmap with the scaled one. */
|
||||
grub_video_bitmap_destroy (bitmap);
|
||||
bitmap = scaled_bitmap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* If bitmap was loaded correctly, display it. */
|
||||
if (bitmap)
|
||||
{
|
||||
if (window.width != grub_video_bitmap_get_width (bitmap)
|
||||
|| window.height != grub_video_bitmap_get_height (bitmap))
|
||||
{
|
||||
struct grub_video_bitmap *scaled_bitmap;
|
||||
grub_video_bitmap_create_scaled (&scaled_bitmap,
|
||||
window.width,
|
||||
window.height,
|
||||
bitmap,
|
||||
GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST);
|
||||
if (grub_errno == GRUB_ERR_NONE)
|
||||
{
|
||||
/* Replace the original bitmap with the scaled one. */
|
||||
grub_video_bitmap_destroy (bitmap);
|
||||
bitmap = scaled_bitmap;
|
||||
}
|
||||
}
|
||||
/* Determine bitmap dimensions. */
|
||||
bitmap_width = grub_video_bitmap_get_width (bitmap);
|
||||
bitmap_height = grub_video_bitmap_get_height (bitmap);
|
||||
|
||||
/* Mark whole screen as dirty. */
|
||||
dirty_region_add (0, 0, window.width, window.height);
|
||||
}
|
||||
|
||||
/* If bitmap was loaded correctly, display it. */
|
||||
if (bitmap)
|
||||
{
|
||||
/* Determine bitmap dimensions. */
|
||||
bitmap_width = grub_video_bitmap_get_width (bitmap);
|
||||
bitmap_height = grub_video_bitmap_get_height (bitmap);
|
||||
|
||||
/* Mark whole screen as dirty. */
|
||||
dirty_region_add (0, 0, window.width, window.height);
|
||||
}
|
||||
}
|
||||
|
||||
/* All was ok. */
|
||||
|
|
Loading…
Reference in a new issue