diff options
author | Adrian Lees <adrian@aemulor.com> | 2009-02-27 01:14:04 +0000 |
---|---|---|
committer | Adrian Lees <adrian@aemulor.com> | 2009-02-27 01:14:04 +0000 |
commit | 464b7edf0c2446f427eb84e726b031d43a25ed0f (patch) | |
tree | 77bb1de49c8ae461c5772bee9b2a29f2088d51e7 /framebuffer/fb_plotters.h | |
parent | 66885831a7b8666cc92c319e99c077457b1736d9 (diff) | |
download | netsurf-464b7edf0c2446f427eb84e726b031d43a25ed0f.tar.gz netsurf-464b7edf0c2446f427eb84e726b031d43a25ed0f.tar.bz2 |
Sketch of possible optimisations; disabled pending testing and fixing
svn path=/trunk/netsurf/; revision=6652
Diffstat (limited to 'framebuffer/fb_plotters.h')
-rw-r--r-- | framebuffer/fb_plotters.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/framebuffer/fb_plotters.h b/framebuffer/fb_plotters.h index 33a929b5c..374228ee2 100644 --- a/framebuffer/fb_plotters.h +++ b/framebuffer/fb_plotters.h @@ -50,6 +50,7 @@ bool fb_plotters_bitmap_tile(int x, int y, /* alpha blend two pixels together */ static inline colour fb_plotters_ablend(colour pixel, colour scrpixel) { +#if 1 int opacity = (pixel >> 24) & 0xFF; int r,g,b; @@ -63,6 +64,18 @@ static inline colour fb_plotters_ablend(colour pixel, colour scrpixel) ((((scrpixel & 0xFF0000) >> 16) * (0xFF - opacity)) >> 8); return r | (g << 8) | (b << 16); +#else + int opacity = pixel >> 24; + int transp = 0x100 - opacity; + uint32_t rb, g; + + rb = ((pixel & 0xFF00FF) * opacity + + (scrpixel & 0xFF00FF) * transp) >> 8; + g = ((pixel & 0x00FF00) * opacity + + (scrpixel & 0x00FF00) * transp) >> 8; + + return rb | g; +#endif } |