From e7cbf49fb91b6508e2c65c5fbe24d775e5fe7be2 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 7 May 2009 18:40:33 +0000 Subject: Some optimisations, makes page rendering much quicker at least on OS4.1. svn path=/trunk/netsurf/; revision=7431 --- amiga/gui.c | 9 +++++++-- amiga/plotters.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 53 insertions(+), 5 deletions(-) (limited to 'amiga') diff --git a/amiga/gui.c b/amiga/gui.c index 4d5e98208..39ea08dc8 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -540,8 +540,11 @@ void gui_init2(int argc, char** argv) SetDrMd(&glob.rp,BGBACKFILL); glob.layerinfo = NewLayerInfo(); + glob.rp.Layer = CreateUpfrontLayer(glob.layerinfo,glob.bm,0,0, - scrn->Width-1,scrn->Width-1,0,NULL); + scrn->Width-1,scrn->Width-1,LAYERSIMPLE,NULL); + + InstallLayerHook(glob.rp.Layer,LAYERS_NOBACKFILL); glob.areabuf = AllocVec(100,MEMF_PRIVATE | MEMF_CLEAR); glob.rp.AreaInfo = AllocVec(sizeof(struct AreaInfo),MEMF_PRIVATE | MEMF_CLEAR); @@ -1672,6 +1675,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw, WA_SizeGadget, TRUE, WA_CustomScreen,scrn, WA_ReportMouse,TRUE, + WA_SimpleRefresh,TRUE, WA_IDCMP,IDCMP_MENUPICK | IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE | IDCMP_RAWKEY | IDCMP_GADGETUP | IDCMP_IDCMPUPDATE | IDCMP_INTUITICKS | IDCMP_EXTENDEDMOUSE, @@ -1752,6 +1756,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw, WA_Height,curh, WA_CustomScreen,scrn, WA_ReportMouse,TRUE, + WA_SimpleRefresh,TRUE, WA_IDCMP,IDCMP_MENUPICK | IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE | IDCMP_RAWKEY | @@ -2242,7 +2247,7 @@ void ami_do_redraw(struct gui_window_2 *g,bool scroll) if (c->locked) return; current_redraw_browser = g->bw; - currp = &glob.rp; +// currp = &glob.rp; width=bbox->Width; height=bbox->Height; diff --git a/amiga/plotters.c b/amiga/plotters.c index 1a746d202..ce1184703 100755 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -29,6 +29,7 @@ #include #include "amiga/options.h" #include +#include #include "utils/log.h" #include #include @@ -250,6 +251,7 @@ bool ami_clip(int x0, int y0, int x1, int y1) if(currp->Layer) { + reg = InstallClipRegion(currp->Layer,NULL); if(!reg) @@ -364,7 +366,26 @@ bool ami_bitmap(int x, int y, int width, int height, if(!tbm) return true; - BltBitMapTags(BLITA_Width,width, + if(GfxBase->lib_Version >= 53) // AutoDoc says v52, but this function isn't in OS4.0, so checking for v53 (OS4.1) + { + uint32 comptype = COMPOSITE_Src; + if(!bitmap->opaque) comptype = COMPOSITE_Src_Over_Dest; + + CompositeTags(comptype,tbm,currp->BitMap, + COMPTAG_Flags,COMPFLAG_IgnoreDestAlpha, + COMPTAG_DestX,glob.rect.MinX, + COMPTAG_DestY,glob.rect.MinY, + COMPTAG_DestWidth,glob.rect.MaxX - glob.rect.MinX, + COMPTAG_DestHeight,glob.rect.MaxY - glob.rect.MinY, + COMPTAG_SrcWidth,width, + COMPTAG_SrcHeight,height, + COMPTAG_OffsetX,x, + COMPTAG_OffsetY,y, + TAG_DONE); + } + else + { + BltBitMapTags(BLITA_Width,width, BLITA_Height,height, BLITA_Source,tbm, BLITA_Dest,currp, @@ -372,8 +393,10 @@ bool ami_bitmap(int x, int y, int width, int height, BLITA_DestY,y, BLITA_SrcType,BLITT_BITMAP, BLITA_DestType,BLITT_RASTPORT, +// BLITA_Mask,0xFF, BLITA_UseSrcAlpha,!bitmap->opaque, TAG_DONE); + } if(tbm != bitmap->nativebm) { @@ -413,7 +436,26 @@ bool ami_bitmap_tile(int x, int y, int width, int height, assert(tbm); - BltBitMapTags(BLITA_Width,width, + if(GfxBase->lib_Version >= 53) // AutoDoc says v52, but this function isn't in OS4.0, so checking for v53 (OS4.1) + { + uint32 comptype = COMPOSITE_Src; + if(!bitmap->opaque) comptype = COMPOSITE_Src_Over_Dest; + + CompositeTags(comptype,tbm,currp->BitMap, + COMPTAG_Flags,COMPFLAG_IgnoreDestAlpha, + COMPTAG_DestX,glob.rect.MinX, + COMPTAG_DestY,glob.rect.MinY, + COMPTAG_DestWidth,glob.rect.MaxX - glob.rect.MinX, + COMPTAG_DestHeight,glob.rect.MaxY - glob.rect.MinY, + COMPTAG_SrcWidth,width, + COMPTAG_SrcHeight,height, + COMPTAG_OffsetX,xf, + COMPTAG_OffsetY,yf, + TAG_DONE); + } + else + { + BltBitMapTags(BLITA_Width,width, BLITA_Height,height, BLITA_Source,tbm, BLITA_Dest,currp, @@ -421,9 +463,10 @@ bool ami_bitmap_tile(int x, int y, int width, int height, BLITA_DestY,yf, BLITA_SrcType,BLITT_BITMAP, BLITA_DestType,BLITT_RASTPORT, +// BLITA_Mask,0xFF, BLITA_UseSrcAlpha,!bitmap->opaque, TAG_DONE); - + } if (!repeat_y) break; } -- cgit v1.2.3