diff options
author | Andre Heider <a.heider@gmail.com> | 2013-11-05 00:01:00 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-11-06 09:59:04 +0100 |
commit | 3ad17654675d1fc71f55dc77e7510d243bdfab38 (patch) | |
tree | 1a23943ebc37896b7b2ff943e313adf23986261d /lib | |
parent | 485544f0fb173e1fe59b70bca0894898a37e9fb0 (diff) | |
download | barebox-3ad17654675d1fc71f55dc77e7510d243bdfab38.tar.gz barebox-3ad17654675d1fc71f55dc77e7510d243bdfab38.tar.xz |
gui: convert graphic utils to respect line_length
Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gui/graphic_utils.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/gui/graphic_utils.c b/lib/gui/graphic_utils.c index 95687df13e..300c525b0e 100644 --- a/lib/gui/graphic_utils.c +++ b/lib/gui/graphic_utils.c @@ -167,18 +167,18 @@ void rgba_blend(struct fb_info *info, struct image *img, void* buf, int height, { unsigned char *adr; int x, y; - int xres; + int line_length; int img_byte_per_pixel = 3; void *image; if (is_rgba) img_byte_per_pixel++; - xres = info->xres; + line_length = info->line_length; for (y = 0; y < height; y++) { - adr = buf + ((y + starty) * xres + startx) * - (info->bits_per_pixel >> 3); + adr = buf + (y + starty) * line_length + + startx * (info->bits_per_pixel >> 3); image = img->data + (y * img->width *img_byte_per_pixel); for (x = 0; x < width; x++) { @@ -219,7 +219,7 @@ int fb_open(const char * fbdev, struct screen *sc, bool offscreen) sc->s.y = 0; sc->s.width = sc->info.xres; sc->s.height = sc->info.yres; - sc->fbsize = sc->s.width * sc->s.height * (sc->info.bits_per_pixel >> 3); + sc->fbsize = sc->info.line_length * sc->s.height; if (offscreen) { /* Don't fail if malloc fails, just continue rendering directly |