diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2010-07-08 14:36:53 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2010-07-08 14:36:53 +0000 |
commit | 45f84e713c825bedd16d4f7765198a9b3ec70b46 (patch) | |
tree | cdd32bb056b10ee2ba201b5d36a04fbcf6f30660 /src/plot | |
parent | a28fbb90a05f9c3c8ca1756f4e6943be99b690c3 (diff) | |
download | libnsfb-45f84e713c825bedd16d4f7765198a9b3ec70b46.tar.gz libnsfb-45f84e713c825bedd16d4f7765198a9b3ec70b46.tar.bz2 |
Make slight changes to match 16bpp implementations of bitmap plotters.
svn path=/trunk/libnsfb/; revision=10610
Diffstat (limited to 'src/plot')
-rw-r--r-- | src/plot/32bpp.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/plot/32bpp.c b/src/plot/32bpp.c index 01cdfbb..28c7962 100644 --- a/src/plot/32bpp.c +++ b/src/plot/32bpp.c @@ -327,7 +327,7 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc, int bmp_stride, bool alpha) { uint32_t *pvideo, *pvideo_limit; - nsfb_colour_t abpixel = 0; /* alphablended pixel */ + nsfb_colour_t abpixel; /* alphablended pixel */ int xloop; int xoff, yoff, xoffs; /* x and y offsets into image */ int x = loc->x0; @@ -348,9 +348,8 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc, clipped.x1 = x + width; clipped.y1 = y + height; - if (!nsfb_plot_clip_ctx(nsfb, &clipped)) { + if (!nsfb_plot_clip_ctx(nsfb, &clipped)) return true; - } /* get height of rendering region, after clipping */ if (height > (clipped.y1 - clipped.y0)) @@ -389,12 +388,12 @@ static bool bitmap_scaled(nsfb_t *nsfb, const nsfb_bbox_t *loc, /* get value of source pixel in question */ abpixel = pixel[yoff + xoff]; if ((abpixel & 0xFF000000) != 0) { - /* pixel is not transparent; have to - * plot something */ + /* pixel is not transparent; have to + * plot something */ if ((abpixel & 0xFF000000) != 0xFF000000) { - /* pixel is not opaque; need to - * blend */ + /* pixel is not opaque; need to + * blend */ abpixel = nsfb_plot_ablend( abpixel, pixel_to_colour( @@ -463,7 +462,7 @@ bitmap(nsfb_t *nsfb, bool alpha) { uint32_t *pvideo; - nsfb_colour_t abpixel = 0; /* alphablended pixel */ + nsfb_colour_t abpixel; /* alphablended pixel */ int xloop, yloop; int xoff, yoff; /* x and y offset into image */ int x = loc->x0; @@ -485,9 +484,8 @@ bitmap(nsfb_t *nsfb, clipped.x1 = x + width; clipped.y1 = y + height; - if (!nsfb_plot_clip_ctx(nsfb, &clipped)) { + if (!nsfb_plot_clip_ctx(nsfb, &clipped)) return true; - } if (height > (clipped.y1 - clipped.y0)) height = (clipped.y1 - clipped.y0); |