diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2015-01-20 20:03:55 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2015-01-20 20:03:55 +0000 |
commit | d0f7247ea67491b4bfae28cb90538b68c6f83d70 (patch) | |
tree | 5a11197792c9d5a1279b38c5d24acdfa4b9dfa85 /amiga/plotters.c | |
parent | 65ab38fc1c26bed356fc61dd4adfe1f0495fab65 (diff) | |
parent | 2b9df1b2cd30e394ebb4e9be721b7d219c4e418c (diff) | |
download | netsurf-d0f7247ea67491b4bfae28cb90538b68c6f83d70.tar.gz netsurf-d0f7247ea67491b4bfae28cb90538b68c6f83d70.tar.bz2 |
Merge branch 'master' of git://git.netsurf-browser.org/netsurf
Diffstat (limited to 'amiga/plotters.c')
-rwxr-xr-x | amiga/plotters.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/amiga/plotters.c b/amiga/plotters.c index 855d10497..eaf775183 100755 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -16,7 +16,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "amiga/os3support.h" + +#ifdef __amigaos4__ #include <proto/Picasso96API.h> +#endif #include <proto/exec.h> #include <proto/intuition.h> @@ -46,7 +50,9 @@ #include "amiga/gui.h" #include "amiga/utf8.h" +#ifdef __amigaos4__ static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct BackFillMessage *bfmsg); +#endif struct bfbitmap { struct BitMap *bm; @@ -114,7 +120,9 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height) } else { palette_mapped = false; } - +#ifndef __amigaos4__ + palette_mapped = true; /* only supporting palette mapped screens on OS3 for now */ +#endif if(!width) width = nsoption_int(redraw_tile_size_x); if(!height) height = nsoption_int(redraw_tile_size_y); @@ -138,7 +146,6 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height) InitRastPort(gg->rp); gg->rp->BitMap = gg->bm; - /* Is all this safe to do to an existing window RastPort? */ SetDrMd(gg->rp,BGBACKFILL); gg->rp->Layer = CreateUpfrontLayer(gg->layerinfo,gg->rp->BitMap,0,0, @@ -232,9 +239,11 @@ void ami_plot_release_pens(struct MinList *shared_pens) static void ami_plot_setapen(ULONG colr) { if(palette_mapped == false) { +#ifdef __amigaos4__ SetRPAttrs(glob->rp, RPTAG_APenColor, ns_color_to_nscss(colr), TAG_DONE); +#endif } else { LONG pen = ami_plot_obtain_pen(glob->shared_pens, colr); if(pen != -1) SetAPen(glob->rp, pen); @@ -244,9 +253,11 @@ static void ami_plot_setapen(ULONG colr) static void ami_plot_setopen(ULONG colr) { if(palette_mapped == false) { +#ifdef __amigaos4__ SetRPAttrs(glob->rp, RPTAG_OPenColor, ns_color_to_nscss(colr), TAG_DONE); +#endif } else { LONG pen = ami_plot_obtain_pen(glob->shared_pens, colr); if(pen != -1) SetOPen(glob->rp, pen); @@ -521,7 +532,7 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma if((tag_data = (ULONG)ami_bitmap_get_mask(bitmap, width, height, tbm))) minterm = (ABC|ABNC|ANBC); } - +#ifdef __amigaos4__ BltBitMapTags(BLITA_Width,width, BLITA_Height,height, BLITA_Source,tbm, @@ -533,6 +544,10 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma BLITA_Minterm, minterm, tag, tag_data, TAG_DONE); +#else + /* Assume mask is always required */ + BltMaskBitMapRastPort(tbm, 0, 0, glob->rp, x, y, width, height, tag_data, minterm); +#endif } if((bitmap->dto == NULL) && (tbm != bitmap->nativebm)) @@ -562,7 +577,7 @@ bool ami_bitmap_tile(int x, int y, int width, int height, if(!(repeat_x || repeat_y)) return ami_bitmap(x, y, width, height, bitmap); - +#ifdef __amigaos4__ /* If it is a one pixel transparent image, we are wasting our time */ if((bitmap->opaque == false) && (bitmap->width == 1) && (bitmap->height == 1)) return true; @@ -641,10 +656,13 @@ bool ami_bitmap_tile(int x, int y, int width, int height, { p96FreeBitMap(tbm); } - +#else +#warning FIXME: bitmap tiling uses backfill hooks +#endif return true; } +#ifdef __amigaos4__ static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct BackFillMessage *bfmsg) { int xf,yf; @@ -700,6 +718,7 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct Ba } } } +#endif bool ami_group_start(const char *name) { |