From 37eae24d5ca6ede0d4cf15623caf3472c0f90c67 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 18 Mar 2009 21:08:23 +0000 Subject: add opaque switch to 16bpp plotters svn path=/trunk/netsurf/; revision=6798 --- framebuffer/fb_16bpp_plotters.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'framebuffer') diff --git a/framebuffer/fb_16bpp_plotters.c b/framebuffer/fb_16bpp_plotters.c index 975dd98cb..369683fde 100644 --- a/framebuffer/fb_16bpp_plotters.c +++ b/framebuffer/fb_16bpp_plotters.c @@ -489,19 +489,29 @@ static bool fb_16bpp_bitmap(int x, int y, int width, int height, /* plot the image */ pvideo = fb_16bpp_get_xy_loc(x0, y0); - 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_16bpp_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 >> 1); + } + } 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_16bpp_to_colour(*(pvideo + xloop))); + } + + *(pvideo + xloop) = fb_colour_to_pixel(abpixel); + } + } + pvideo += (framebuffer->linelen >> 1); } - pvideo += (framebuffer->linelen >> 1); } return true; -- cgit v1.2.3