Some optimisations, makes page rendering much quicker at least on OS4.1.

svn path=/trunk/netsurf/; revision=7431
This commit is contained in:
Chris Young 2009-05-07 18:40:33 +00:00
parent c2ecbebd3d
commit e7cbf49fb9
2 changed files with 53 additions and 5 deletions

View File

@ -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;

View File

@ -29,6 +29,7 @@
#include <proto/layers.h>
#include "amiga/options.h"
#include <graphics/blitattr.h>
#include <graphics/composite.h>
#include "utils/log.h"
#include <math.h>
#include <assert.h>
@ -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;
}