From a588aa92c915a6da4ad01269a615318cf3c66442 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 7 Feb 2009 10:45:58 +0000 Subject: Enable/disable caching of native bitmaps in gfx board mem svn path=/trunk/netsurf/; revision=6393 --- amiga/plotters.c | 47 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 9 deletions(-) (limited to 'amiga/plotters.c') diff --git a/amiga/plotters.c b/amiga/plotters.c index b19ee394c..3a55772d0 100755 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -477,9 +477,21 @@ bool ami_bitmap(int x, int y, int width, int height, BLITA_UseSrcAlpha,!bitmap->opaque, TAG_DONE); - bitmap->nativebm = scaledbm; - //p96FreeBitMap(scaledbm); + if(option_cache_bitmaps >= 1) + { + if(bitmap->nativebm) + { + p96FreeBitMap(bitmap->nativebm); + } + + bitmap->nativebm = scaledbm; + } + else + { + p96FreeBitMap(scaledbm); + } + p96FreeBitMap(tbm); } else { @@ -494,7 +506,19 @@ bool ami_bitmap(int x, int y, int width, int height, BLITA_UseSrcAlpha,!bitmap->opaque, TAG_DONE); - bitmap->nativebm = tbm; + if(option_cache_bitmaps == 2) + { + if(bitmap->nativebm) + { + p96FreeBitMap(bitmap->nativebm); + } + + bitmap->nativebm = tbm; + } + else + { + p96FreeBitMap(tbm); + } } bitmap->nativebmwidth = width; @@ -514,8 +538,6 @@ bool ami_bitmap(int x, int y, int width, int height, TAG_DONE); } -// p96FreeBitMap(tbm); - return true; } @@ -557,9 +579,13 @@ bool ami_bitmap_tile(int x, int y, int width, int height, InitRastPort(&trp); trp.BitMap = tbm; p96WritePixelArray((struct RenderInfo *)&ri,0,0,&trp,0,0,bitmap->width,bitmap->height); - bitmap->nativebm = tbm; - bitmap->nativebmwidth = bitmap->width; - bitmap->nativebmheight = bitmap->height; + + if(option_cache_bitmaps == 2) + { + bitmap->nativebm = tbm; + bitmap->nativebmwidth = bitmap->width; + bitmap->nativebmheight = bitmap->height; + } } max_width = (repeat_x ? scrn->Width : width); @@ -603,7 +629,10 @@ bool ami_bitmap_tile(int x, int y, int width, int height, } } -// p96FreeBitMap(tbm); + if(option_cache_bitmaps != 2) + { + p96FreeBitMap(tbm); + } return true; } -- cgit v1.2.3