mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-24 21:16:50 +03:00
More efficient layers clipping
svn path=/trunk/netsurf/; revision=5945
This commit is contained in:
parent
e56aabc998
commit
96c314750f
@ -124,6 +124,7 @@ struct gui_globals
|
||||
struct Layer_Info *layerinfo;
|
||||
APTR areabuf;
|
||||
APTR tmprasbuf;
|
||||
struct Rectangle rect;
|
||||
#ifdef NS_AMIGA_CAIRO
|
||||
cairo_surface_t *surface;
|
||||
cairo_t *cr;
|
||||
|
@ -244,21 +244,28 @@ bool ami_fill(int x0, int y0, int x1, int y1, colour c)
|
||||
bool ami_clip(int x0, int y0, int x1, int y1)
|
||||
{
|
||||
struct Region *reg = NULL;
|
||||
struct Rectangle rect;
|
||||
|
||||
if(currp->Layer)
|
||||
{
|
||||
reg = NewRegion();
|
||||
reg = InstallClipRegion(currp->Layer,NULL);
|
||||
|
||||
rect.MinX = x0;
|
||||
rect.MinY = y0;
|
||||
rect.MaxX = x1-1;
|
||||
rect.MaxY = y1-1;
|
||||
if(!reg)
|
||||
{
|
||||
reg = NewRegion();
|
||||
}
|
||||
else
|
||||
{
|
||||
ClearRectRegion(reg,&glob.rect);
|
||||
}
|
||||
|
||||
OrRectRegion(reg,&rect);
|
||||
glob.rect.MinX = x0;
|
||||
glob.rect.MinY = y0;
|
||||
glob.rect.MaxX = x1-1;
|
||||
glob.rect.MaxY = y1-1;
|
||||
|
||||
OrRectRegion(reg,&glob.rect);
|
||||
|
||||
reg = InstallClipRegion(currp->Layer,reg);
|
||||
|
||||
if(reg) DisposeRegion(reg);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user