X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fdevices%2Farts.c;h=78986ecc78f7010f5c55f794b7e4e9948fa407eb;hb=8e19aa73faaa2990c0bec79ed45d38ef343c0a67;hp=98aed191636e29ec963aa90557599e6ad847428e;hpb=9916c6d9fdd191129957fda1eca9b6cc97169c59;p=swftools.git diff --git a/lib/devices/arts.c b/lib/devices/arts.c index 98aed19..78986ec 100644 --- a/lib/devices/arts.c +++ b/lib/devices/arts.c @@ -40,7 +40,7 @@ typedef struct _internal { ArtSVP*svpunion; } internal_t; -static int verbose = 1; +static int verbose = 0; static void dbg(char*format, ...) { if(!verbose) @@ -145,6 +145,20 @@ void arts_fill(struct _gfxdevice*dev, gfxline_t*line, gfxcolor_t*color) internal_t*i = (internal_t*)dev->internal; ArtSVP* svp = gfxfillToSVP(line, 1); + if (svp->n_segs > 500) + { + int lineParts = 0; + gfxline_t* lineCursor = line; + while(lineCursor != NULL) + { + if(lineCursor->type != gfx_moveTo) ++lineParts; + lineCursor = lineCursor->next; + } + fprintf(stderr, "arts_fill abandonning shape with %d segments (%d line parts)\n", svp->n_segs, lineParts); + art_svp_free(svp); + return; + } + svp = art_svp_rewind_uncrossed(art_svp_uncross(svp),ART_WIND_RULE_ODDEVEN); /*FIXME*/ if(i->clip) { @@ -164,6 +178,7 @@ void arts_fillbitmap(struct _gfxdevice*dev, gfxline_t*line, gfximage_t*img, gfxm dbg("arts_fillbitmap"); internal_t*i = (internal_t*)dev->internal; ArtSVP* svp = gfxfillToSVP(line, 1); + if(i->clip) { ArtSVP*old = svp; svp = art_svp_intersect(svp, i->clip->svp);