diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2013-01-27 23:09:26 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2013-01-27 23:09:26 +0000 |
commit | 7710214ec2306f2faa7fa2300b4972f5f0151127 (patch) | |
tree | 1d75811136c5298f468a9656c86742f62f89c41a /amiga/plotters.c | |
parent | a30d51cb50f130bc91c7ee13b6656f1e64c94215 (diff) | |
download | netsurf-7710214ec2306f2faa7fa2300b4972f5f0151127.tar.gz netsurf-7710214ec2306f2faa7fa2300b4972f5f0151127.tar.bz2 |
Remove p96EncodeColour and ensure the alpha byte is set to 0xff.
Diffstat (limited to 'amiga/plotters.c')
-rwxr-xr-x | amiga/plotters.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/amiga/plotters.c b/amiga/plotters.c index 7347f064d..595ec0d14 100755 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -1,5 +1,5 @@ /* - * Copyright 2008, 2009, 2012 Chris Young <chris@unsatisfactorysoftware.co.uk> + * Copyright 2008-09, 2012-13 Chris Young <chris@unsatisfactorysoftware.co.uk> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -101,6 +101,18 @@ const struct plotter_table amiplot = { .option_knockout = true, }; +colour ami_abgr_to_argb(colour c) { + colour argb = 0x00000000; + + /* NB: We force the alpha byte to be 0xff, as it is not set by the core. */ + argb = 0xff000000 | + ((c & 0x00ff0000) >> 16) | + (c & 0x0000ff00) | + ((c & 0x000000ff) << 16); + + return argb; +} + #ifdef NS_AMIGA_CAIRO void ami_cairo_set_colour(cairo_t *cr,colour c) { @@ -285,7 +297,7 @@ static void ami_plot_setapen(ULONG colour) { if(palette_mapped == false) { SetRPAttrs(glob->rp, RPTAG_APenColor, - p96EncodeColor(RGBFB_A8B8G8R8, colour), + ami_abgr_to_argb(colour), TAG_DONE); } else { ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colour); @@ -297,7 +309,7 @@ static void ami_plot_setopen(ULONG colour) { if(palette_mapped == false) { SetRPAttrs(glob->rp, RPTAG_OPenColor, - p96EncodeColor(RGBFB_A8B8G8R8, colour), + ami_abgr_to_argb(colour), TAG_DONE); } else { ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colour); |