summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2008-12-29 01:18:53 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2008-12-29 01:18:53 +0000
commit96c314750f05bf97e9cdde8371c463d79850b32c (patch)
treef2cc821cf366cc10c74aec8ef6b3e405a704e807 /amiga
parente56aabc99879f8c5e764142be4cc8d21b0da934d (diff)
downloadnetsurf-96c314750f05bf97e9cdde8371c463d79850b32c.tar.gz
netsurf-96c314750f05bf97e9cdde8371c463d79850b32c.tar.bz2
More efficient layers clipping
svn path=/trunk/netsurf/; revision=5945
Diffstat (limited to 'amiga')
-rwxr-xr-xamiga/gui.h1
-rwxr-xr-xamiga/plotters.c23
2 files changed, 16 insertions, 8 deletions
diff --git a/amiga/gui.h b/amiga/gui.h
index 723b6950f..4a7f2b521 100755
--- a/amiga/gui.h
+++ b/amiga/gui.h
@@ -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;
diff --git a/amiga/plotters.c b/amiga/plotters.c
index b3d1baa43..c990ddd9f 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -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;
- reg = InstallClipRegion(currp->Layer,reg);
+ OrRectRegion(reg,&glob.rect);
+ reg = InstallClipRegion(currp->Layer,reg);
if(reg) DisposeRegion(reg);
}