2009-08-18 Pavel Roskin <proski@gnu.org>
* include/grub/fbfill.h (struct grub_video_fbrender_target): Use grub_uint8_t pointer for data. * include/grub/fbutil.h (struct grub_video_fbblit_info): Likewise. * video/fb/fbutil.c: Remove unnecessary casts.
This commit is contained in:
parent
19f1b335c3
commit
b7da6babe8
4 changed files with 16 additions and 18 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2009-08-18 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* include/grub/fbfill.h (struct grub_video_fbrender_target): Use
|
||||||
|
grub_uint8_t pointer for data.
|
||||||
|
* include/grub/fbutil.h (struct grub_video_fbblit_info):
|
||||||
|
Likewise.
|
||||||
|
* video/fb/fbutil.c: Remove unnecessary casts.
|
||||||
|
|
||||||
2009-08-17 Michal Suchanek <hramrach@centrum.cz>
|
2009-08-17 Michal Suchanek <hramrach@centrum.cz>
|
||||||
|
|
||||||
VBE cleanup.
|
VBE cleanup.
|
||||||
|
|
|
@ -44,7 +44,7 @@ struct grub_video_fbrender_target
|
||||||
|
|
||||||
/* Pointer to data. Can either be in video card memory or in local host's
|
/* Pointer to data. Can either be in video card memory or in local host's
|
||||||
memory. */
|
memory. */
|
||||||
void *data;
|
grub_uint8_t *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
struct grub_video_fbblit_info
|
struct grub_video_fbblit_info
|
||||||
{
|
{
|
||||||
struct grub_video_mode_info *mode_info;
|
struct grub_video_mode_info *mode_info;
|
||||||
void *data;
|
grub_uint8_t *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
grub_uint8_t *grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source,
|
grub_uint8_t *grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source,
|
||||||
|
|
|
@ -40,28 +40,20 @@ grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source,
|
||||||
switch (source->mode_info->bpp)
|
switch (source->mode_info->bpp)
|
||||||
{
|
{
|
||||||
case 32:
|
case 32:
|
||||||
ptr = (grub_uint8_t *)source->data
|
ptr = source->data + y * source->mode_info->pitch + x * 4;
|
||||||
+ y * source->mode_info->pitch
|
|
||||||
+ x * 4;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 24:
|
case 24:
|
||||||
ptr = (grub_uint8_t *)source->data
|
ptr = source->data + y * source->mode_info->pitch + x * 3;
|
||||||
+ y * source->mode_info->pitch
|
|
||||||
+ x * 3;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 16:
|
case 16:
|
||||||
case 15:
|
case 15:
|
||||||
ptr = (grub_uint8_t *)source->data
|
ptr = source->data + y * source->mode_info->pitch + x * 2;
|
||||||
+ y * source->mode_info->pitch
|
|
||||||
+ x * 2;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
ptr = (grub_uint8_t *)source->data
|
ptr = source->data + y * source->mode_info->pitch + x;
|
||||||
+ y * source->mode_info->pitch
|
|
||||||
+ x;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -107,8 +99,7 @@ get_pixel (struct grub_video_fbblit_info *source,
|
||||||
if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED)
|
if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED)
|
||||||
{
|
{
|
||||||
int bit_index = y * source->mode_info->width + x;
|
int bit_index = y * source->mode_info->width + x;
|
||||||
grub_uint8_t *ptr = (grub_uint8_t *)source->data
|
grub_uint8_t *ptr = source->data + bit_index / 8;
|
||||||
+ bit_index / 8;
|
|
||||||
int bit_pos = 7 - bit_index % 8;
|
int bit_pos = 7 - bit_index % 8;
|
||||||
color = (*ptr >> bit_pos) & 0x01;
|
color = (*ptr >> bit_pos) & 0x01;
|
||||||
}
|
}
|
||||||
|
@ -175,8 +166,7 @@ set_pixel (struct grub_video_fbblit_info *source,
|
||||||
if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED)
|
if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED)
|
||||||
{
|
{
|
||||||
int bit_index = y * source->mode_info->width + x;
|
int bit_index = y * source->mode_info->width + x;
|
||||||
grub_uint8_t *ptr = (grub_uint8_t *)source->data
|
grub_uint8_t *ptr = source->data + bit_index / 8;
|
||||||
+ bit_index / 8;
|
|
||||||
int bit_pos = 7 - bit_index % 8;
|
int bit_pos = 7 - bit_index % 8;
|
||||||
*ptr = (*ptr & ~(1 << bit_pos)) | ((color & 0x01) << bit_pos);
|
*ptr = (*ptr & ~(1 << bit_pos)) | ((color & 0x01) << bit_pos);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue