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/dist/NetSurf.guide | 3 ++- amiga/options.h | 6 +++--- amiga/plotters.c | 47 ++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 43 insertions(+), 13 deletions(-) (limited to 'amiga') diff --git a/amiga/dist/NetSurf.guide b/amiga/dist/NetSurf.guide index 7d8b36d8a..45d9d06b5 100755 --- a/amiga/dist/NetSurf.guide +++ b/amiga/dist/NetSurf.guide @@ -45,7 +45,8 @@ The options file is stored in @{"Resources/Options" link Resources/Options/Main} @{b}arexx_dir@{ub} Path to ARexx scripts dir @{b}download_dir@{ub} default download destination @{b}quick_text@{ub} enable for local charset text only (not recommended) -@{b}delay_redraw@{ub} slows down redraw interval +@{b}faster_scroll@{ub} enable faster scrolling (experimental) +@{b}cache_bitmaps@{ub} cache bitmaps in native format in gfx mem (0=off, 1=sclaed, 2=all) @endnode diff --git a/amiga/options.h b/amiga/options.h index 35b71f216..adba19c92 100644 --- a/amiga/options.h +++ b/amiga/options.h @@ -25,7 +25,7 @@ extern char *option_url_file; extern char *option_hotlist_file; extern char *option_use_pubscreen; extern char *option_modeid; -extern int option_screen_depth; +extern int option_cache_bitmaps; extern char *option_theme; extern bool option_no_iframes; extern bool option_utf8_clipboard; @@ -47,7 +47,7 @@ char *option_url_file = 0; \ char *option_hotlist_file = 0; \ char *option_use_pubscreen = 0; \ char *option_modeid = 0; \ -int option_screen_depth = 16; \ +int option_cache_bitmaps = 0; \ char *option_theme = 0; \ bool option_no_iframes = false; \ bool option_utf8_clipboard = false; \ @@ -69,7 +69,7 @@ bool option_faster_scroll = false; \ { "hotlist_file", OPTION_STRING, &option_hotlist_file }, \ { "use_pubscreen", OPTION_STRING, &option_use_pubscreen}, \ { "screen_modeid", OPTION_STRING, &option_modeid}, \ -{ "screen_depth", OPTION_INTEGER, &option_screen_depth}, \ +{ "cache_bitmaps", OPTION_INTEGER, &option_cache_bitmaps}, \ { "theme", OPTION_STRING, &option_theme}, \ { "no_iframes", OPTION_BOOL, &option_no_iframes}, \ { "clipboard_write_utf8", OPTION_BOOL, &option_utf8_clipboard}, \ 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