? libs ? miarc-fat-trim-1.patch Index: miarc.c =================================================================== RCS file: /cvs/xorg/xserver/xorg/mi/miarc.c,v retrieving revision 1.8 diff -u -p -r1.8 miarc.c --- miarc.c 28 Mar 2006 01:21:00 -0000 1.8 +++ miarc.c 19 Apr 2006 04:16:30 -0000 @@ -411,52 +411,16 @@ typedef struct { } miArcSpanData; typedef struct { - unsigned long lrustamp; unsigned short lw; unsigned short width, height; miArcSpanData *spdata; } arcCacheRec; -#define CACHESIZE 25 static void drawQuadrant(struct arc_def *def, struct accelerators *acc, int a0, int a1, int mask, miArcFacePtr right, miArcFacePtr left, miArcSpanData *spdata); -static arcCacheRec arcCache[CACHESIZE]; -static unsigned long lrustamp; -static arcCacheRec *lastCacheHit = &arcCache[0]; -static RESTYPE cacheType; - -/* - * External so it can be called when low on memory. - * Call with a zero ID in that case. - */ -/*ARGSUSED*/ -int -miFreeArcCache (data, id) - pointer data; - XID id; -{ - int k; - arcCacheRec *cent; - - if (id) - cacheType = 0; - - for (k = CACHESIZE, cent = &arcCache[0]; --k >= 0; cent++) - { - if (cent->spdata) - { - cent->lrustamp = 0; - cent->lw = 0; - xfree(cent->spdata); - cent->spdata = NULL; - } - } - lrustamp = 0; - return Success; -} static void miComputeCircleSpans( @@ -867,58 +831,30 @@ miComputeWideEllipse( Bool *mustFree) { register miArcSpanData *spdata; - register arcCacheRec *cent, *lruent; register int k; - arcCacheRec fakeent; + static arcCacheRec arcCache; if (!lw) lw = 1; if (parc->height <= 1500) { *mustFree = FALSE; - cent = lastCacheHit; - if (cent->lw == lw && - cent->width == parc->width && cent->height == parc->height) - { - cent->lrustamp = ++lrustamp; - return cent->spdata; - } - lruent = &arcCache[0]; - for (k = CACHESIZE, cent = lruent; --k >= 0; cent++) - { - if (cent->lw == lw && - cent->width == parc->width && cent->height == parc->height) - { - cent->lrustamp = ++lrustamp; - lastCacheHit = cent; - return cent->spdata; - } - if (cent->lrustamp < lruent->lrustamp) - lruent = cent; - } - if (!cacheType) - { - cacheType = CreateNewResourceType(miFreeArcCache); - (void) AddResource(FakeClientID(0), cacheType, NULL); - } - } else { - lruent = &fakeent; - lruent->spdata = NULL; - *mustFree = TRUE; + if (arcCache.lw == lw && + arcCache.width == parc->width && arcCache.height == parc->height) + return arcCache.spdata; } k = (parc->height >> 1) + ((lw - 1) >> 1); - spdata = lruent->spdata; + spdata = arcCache.spdata; if (!spdata || spdata->k != k) { if (spdata) xfree(spdata); spdata = (miArcSpanData *)xalloc(sizeof(miArcSpanData) + sizeof(miArcSpan) * (k + 2)); - lruent->spdata = spdata; + arcCache.spdata = spdata; if (!spdata) { - lruent->lrustamp = 0; - lruent->lw = 0; + arcCache.lw = 0; return spdata; } spdata->spans = (miArcSpan *)(spdata + 1); @@ -926,12 +862,9 @@ miComputeWideEllipse( } spdata->top = !(lw & 1) && !(parc->width & 1); spdata->bot = !(parc->height & 1); - lruent->lrustamp = ++lrustamp; - lruent->lw = lw; - lruent->width = parc->width; - lruent->height = parc->height; - if (lruent != &fakeent) - lastCacheHit = lruent; + arcCache.lw = lw; + arcCache.width = parc->width; + arcCache.height = parc->height; if (parc->width == parc->height) miComputeCircleSpans(lw, parc, spdata); else @@ -3139,8 +3072,8 @@ struct finalSpanChunk { static struct finalSpanChunk *chunks; -struct finalSpan * -realAllocSpan () +static struct finalSpan * +realAllocSpan (void) { register struct finalSpanChunk *newChunk; register struct finalSpan *span; Index: mifillarc.h =================================================================== RCS file: /cvs/xorg/xserver/xorg/mi/mifillarc.h,v retrieving revision 1.4 diff -u -p -r1.4 mifillarc.h --- mifillarc.h 24 Aug 2005 11:18:34 -0000 1.4 +++ mifillarc.h 19 Apr 2006 04:16:30 -0000 @@ -183,10 +183,6 @@ extern int miFreeArcCache( XID /*id*/ ); -extern struct finalSpan *realAllocSpan( - void -); - extern void miFillArcSetup( xArc * /*arc*/, miFillArcRec * /*info*/