From cdc47ee52c6f7904c9024ab9da44eb14ff2e30e1 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 11 Mar 2009 21:28:34 +0000 Subject: bitmap opaque handling svn path=/trunk/netsurf/; revision=6777 --- framebuffer/fb_32bpp_plotters.c | 47 ++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 29 deletions(-) (limited to 'framebuffer/fb_32bpp_plotters.c') diff --git a/framebuffer/fb_32bpp_plotters.c b/framebuffer/fb_32bpp_plotters.c index dcaa6b82f..39d2a87e1 100644 --- a/framebuffer/fb_32bpp_plotters.c +++ b/framebuffer/fb_32bpp_plotters.c @@ -542,41 +542,30 @@ static bool fb_32bpp_bitmap(int x, int y, int width, int height, /* plot the image */ pvideo = fb_32bpp_get_xy_loc(x0, y0); - for (yloop = yoff; yloop < height; yloop += bitmap->width) { -#if 1 - for (xloop = 0; xloop < width; xloop++) { - abpixel = pixel[yloop + xloop + xoff]; - if ((abpixel & 0xFF000000) != 0) { - if ((abpixel & 0xFF000000) != 0xFF000000) { - abpixel = fb_plotters_ablend(abpixel, - fb_32bpp_to_colour(*(pvideo + xloop))); - } - + if (bitmap->opaque) { + for (yloop = yoff; yloop < height; yloop += bitmap->width) { + for (xloop = 0; xloop < width; xloop++) { + abpixel = pixel[yloop + xloop + xoff]; *(pvideo + xloop) = fb_colour_to_pixel(abpixel); } + pvideo += (framebuffer->linelen >> 2); } -#else - uint32_t *pvid = pvideo; - colour *pix = &pixel[yloop + xoff]; - colour *epix = pix + width; - do { - colour *spix = pix; - while (pix < epix && !((abpixel = *pix) & 0xFF000000U)) pix++; - if (pix < epix) { - pvid += pix++ - spix; - do { + } else { + for (yloop = yoff; yloop < height; yloop += bitmap->width) { + for (xloop = 0; xloop < width; xloop++) { + abpixel = pixel[yloop + xloop + xoff]; + if ((abpixel & 0xFF000000) != 0) { if ((abpixel & 0xFF000000) != 0xFF000000) { - abpixel = fb_plotters_ablend(abpixel, - fb_32bpp_to_colour(*pvid)); + abpixel = fb_plotters_ablend(abpixel, + fb_32bpp_to_colour(*(pvideo + xloop))); } - *pvid++ = fb_colour_to_pixel(abpixel); - } while (pix < epix && ((abpixel = *pix++) & 0xFF000000U)); - } - } while (pix < epix); -#endif - pvideo += (framebuffer->linelen >> 2); - } + *(pvideo + xloop) = fb_colour_to_pixel(abpixel); + } + } + pvideo += (framebuffer->linelen >> 2); + } + } return true; } -- cgit v1.2.3