From: Andre Heider <a.heider@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH 3/6] gui: convert the bmp renderer to respect the stride value
Date: Thu, 24 Oct 2013 22:23:43 +0200 [thread overview]
Message-ID: <1382646226-24871-4-git-send-email-a.heider@gmail.com> (raw)
In-Reply-To: <1382646226-24871-1-git-send-email-a.heider@gmail.com>
Signed-off-by: Andre Heider <a.heider@gmail.com>
---
lib/gui/bmp.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/gui/bmp.c b/lib/gui/bmp.c
index 6bf8cd0..bb4de12 100644
--- a/lib/gui/bmp.c
+++ b/lib/gui/bmp.c
@@ -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.stride +
+ 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.stride +
+ startx * (sc->info.bits_per_pixel >> 3);
for (x = 0; x < width; x++) {
char *pixel;
--
1.8.3.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-10-24 20:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-24 20:23 [PATCH 0/6] simple framebuffer driver with RPi support Andre Heider
2013-10-24 20:23 ` [PATCH 1/6] fb: add a stride value to struct fb_info Andre Heider
2013-10-25 10:58 ` Jean-Christophe PLAGNIOL-VILLARD
2013-10-25 11:51 ` Andre Heider
2013-10-25 23:04 ` Sascha Hauer
2013-10-24 20:23 ` [PATCH 2/6] gui: convert graphic utils to respect the stride value Andre Heider
2013-10-24 20:23 ` Andre Heider [this message]
2013-10-24 20:23 ` [PATCH 4/6] video: add a simple framebuffer driver Andre Heider
2013-10-24 20:23 ` [PATCH 5/6] ARM: bcm2835: add missing mbox overscan response field Andre Heider
2013-10-24 20:23 ` [PATCH 6/6] ARM: rpi: add support for simplefb Andre Heider
2013-10-25 7:56 ` [PATCH 0/6] simple framebuffer driver with RPi support Andre Heider
2013-10-25 23:51 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1382646226-24871-4-git-send-email-a.heider@gmail.com \
--to=a.heider@gmail.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox