summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2010-07-08 16:43:41 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2010-07-08 16:43:41 (GMT)
commitfa9e2e6061d565054b3c4e91e468551b72274f44 (patch)
treed7db09440576c56315d73764a50b31ee5f2c77c7
parent60d00a95a3328236b77df4a7dea3b62c4879f922 (diff)
downloadlibnsfb-fa9e2e6061d565054b3c4e91e468551b72274f44.tar.gz
libnsfb-fa9e2e6061d565054b3c4e91e468551b72274f44.tar.bz2
Slight optimisation for scaled image plotting.
svn path=/trunk/libnsfb/; revision=10612
-rw-r--r--src/plot/16bpp.c6
-rw-r--r--src/plot/32bpp.c6
-rw-r--r--src/plot/8bpp.c6
3 files changed, 9 insertions, 9 deletions
diff --git a/src/plot/16bpp.c b/src/plot/16bpp.c
index ce334a3..84aa813 100644
--- a/src/plot/16bpp.c
+++ b/src/plot/16bpp.c
@@ -372,7 +372,7 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc,
/* get veritcal (y) and horizontal (x) scale factors; both integer
* part and remainder */
dx = bmp_width / width;
- dy = bmp_height / height;
+ dy = (bmp_height / height) * bmp_stride;
dxr = bmp_width % width;
dyr = bmp_height % height;
rx = ry = 0; /* initialise remainder counters */
@@ -415,7 +415,7 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc,
}
}
/* handle vertical interpolation */
- yoff += bmp_stride * dy;
+ yoff += dy;
ry += dyr;
if (ry >= height) {
yoff += bmp_stride;
@@ -443,7 +443,7 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc,
}
}
/* handle vertical interpolation */
- yoff += bmp_stride * dy;
+ yoff += dy;
ry += dyr;
if (ry >= height) {
yoff += bmp_stride;
diff --git a/src/plot/32bpp.c b/src/plot/32bpp.c
index 28c7962..220db44 100644
--- a/src/plot/32bpp.c
+++ b/src/plot/32bpp.c
@@ -370,7 +370,7 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc,
/* get veritcal (y) and horizontal (x) scale factors; both integer
* part and remainder */
dx = bmp_width / width;
- dy = bmp_height / height;
+ dy = (bmp_height / height) * bmp_stride;
dxr = bmp_width % width;
dyr = bmp_height % height;
rx = ry = 0; /* initialise remainder counters */
@@ -413,7 +413,7 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc,
}
}
/* handle vertical interpolation */
- yoff += bmp_stride * dy;
+ yoff += dy;
ry += dyr;
if (ry >= height) {
yoff += bmp_stride;
@@ -441,7 +441,7 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc,
}
}
/* handle vertical interpolation */
- yoff += bmp_stride * dy;
+ yoff += dy;
ry += dyr;
if (ry >= height) {
yoff += bmp_stride;
diff --git a/src/plot/8bpp.c b/src/plot/8bpp.c
index 00402f3..4da9df2 100644
--- a/src/plot/8bpp.c
+++ b/src/plot/8bpp.c
@@ -349,7 +349,7 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc,
/* get veritcal (y) and horizontal (x) scale factors; both integer
* part and remainder */
dx = bmp_width / width;
- dy = bmp_height / height;
+ dy = (bmp_height / height) * bmp_stride;
dxr = bmp_width % width;
dyr = bmp_height % height;
rx = ry = 0; /* initialise remainder counters */
@@ -393,7 +393,7 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc,
}
}
/* handle vertical interpolation */
- yoff += bmp_stride * dy;
+ yoff += dy;
ry += dyr;
if (ry >= height) {
yoff += bmp_stride;
@@ -422,7 +422,7 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc,
}
}
/* handle vertical interpolation */
- yoff += bmp_stride * dy;
+ yoff += dy;
ry += dyr;
if (ry >= height) {
yoff += bmp_stride;