9
0
Fork 0

gui: convert the bmp renderer to respect line_length

Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Andre Heider 2013-11-05 00:01:01 +01:00 committed by Sascha Hauer
parent 3ad1765467
commit 9617cfecbe
1 changed files with 4 additions and 4 deletions

View File

@ -78,8 +78,8 @@ static int bmp_renderer(struct screen *sc, struct surface *s, struct image *img)
image = (char *)bmp +
le32_to_cpu(bmp->header.data_offset);
image += (img->height - y - 1) * img->width * (bits_per_pixel >> 3);
adr = buf + ((y + starty) * sc->s.width + startx) *
(sc->info.bits_per_pixel >> 3);
adr = buf + (y + starty) * sc->info.line_length +
startx * (sc->info.bits_per_pixel >> 3);
for (x = 0; x < width; x++) {
int pixel;
@ -100,8 +100,8 @@ static int bmp_renderer(struct screen *sc, struct surface *s, struct image *img)
image = (char *)bmp +
le32_to_cpu(bmp->header.data_offset);
image += (img->height - y - 1) * img->width * (bits_per_pixel >> 3);
adr = buf + ((y + starty) * sc->s.width + startx) *
(sc->info.bits_per_pixel >> 3);
adr = buf + (y + starty) * sc->info.line_length +
startx * (sc->info.bits_per_pixel >> 3);
for (x = 0; x < width; x++) {
char *pixel;