summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2009-02-27 00:12:22 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2009-02-27 00:12:22 +0000
commit66885831a7b8666cc92c319e99c077457b1736d9 (patch)
treedbca9bccfc94c633b44727205017eca22de30f90
parent309767fb57d18bd5429cef879ee37c902e8d6eee (diff)
downloadnetsurf-66885831a7b8666cc92c319e99c077457b1736d9.tar.gz
netsurf-66885831a7b8666cc92c319e99c077457b1736d9.tar.bz2
Fixed version of r6647.
svn path=/trunk/netsurf/; revision=6650
-rw-r--r--framebuffer/fb_16bpp_plotters.c7
-rw-r--r--framebuffer/fb_32bpp_plotters.c7
2 files changed, 8 insertions, 6 deletions
diff --git a/framebuffer/fb_16bpp_plotters.c b/framebuffer/fb_16bpp_plotters.c
index bb1c29f78..74944a9c3 100644
--- a/framebuffer/fb_16bpp_plotters.c
+++ b/framebuffer/fb_16bpp_plotters.c
@@ -462,14 +462,15 @@ static bool fb_16bpp_bitmap(int x, int y, int width, int height,
width = (x1 - x0);
xoff = x0 - x;
- yoff = y0 - y;
+ yoff = (y0 - y) * bitmap->width;
+ height = height * bitmap->width + yoff;
/* plot the image */
pvideo = fb_16bpp_get_xy_loc(x0, y0);
- for (yloop = 0; yloop < height; yloop++) {
+ for (yloop = yoff; yloop < height; yloop += bitmap->width) {
for (xloop = 0; xloop < width; xloop++) {
- abpixel = pixel[((yoff + yloop) * bitmap->width) + xloop + xoff];
+ abpixel = pixel[yloop + xloop + xoff];
if ((abpixel & 0xFF000000) != 0) {
if ((abpixel & 0xFF000000) != 0xFF000000) {
abpixel = fb_plotters_ablend(abpixel,
diff --git a/framebuffer/fb_32bpp_plotters.c b/framebuffer/fb_32bpp_plotters.c
index 45af64626..c6efe5a64 100644
--- a/framebuffer/fb_32bpp_plotters.c
+++ b/framebuffer/fb_32bpp_plotters.c
@@ -518,14 +518,15 @@ static bool fb_32bpp_bitmap(int x, int y, int width, int height,
width = (x1 - x0);
xoff = x0 - x;
- yoff = y0 - y;
+ yoff = (y0 - y) * bitmap->width;
+ height = height * bitmap->width + yoff;
/* plot the image */
pvideo = fb_32bpp_get_xy_loc(x0, y0);
- for (yloop = 0; yloop < height; yloop++) {
+ for (yloop = yoff; yloop < height; yloop += bitmap->width) {
for (xloop = 0; xloop < width; xloop++) {
- abpixel = pixel[((yoff + yloop) * bitmap->width) + xloop + xoff];
+ abpixel = pixel[yloop + xloop + xoff];
if ((abpixel & 0xFF000000) != 0) {
if ((abpixel & 0xFF000000) != 0xFF000000) {
abpixel = fb_plotters_ablend(abpixel,