Static and dead code cleanup from mi/
This commit is contained in:
parent
62224e3972
commit
af769892a9
51
mi/mi.h
51
mi/mi.h
|
@ -85,18 +85,6 @@ extern RegionPtr miCopyArea(
|
|||
int /*yOut*/
|
||||
);
|
||||
|
||||
extern void miOpqStipDrawable(
|
||||
DrawablePtr /*pDraw*/,
|
||||
GCPtr /*pGC*/,
|
||||
RegionPtr /*prgnSrc*/,
|
||||
MiBits * /*pbits*/,
|
||||
int /*srcx*/,
|
||||
int /*w*/,
|
||||
int /*h*/,
|
||||
int /*dstx*/,
|
||||
int /*dsty*/
|
||||
);
|
||||
|
||||
extern RegionPtr miCopyPlane(
|
||||
DrawablePtr /*pSrcDrawable*/,
|
||||
DrawablePtr /*pDstDrawable*/,
|
||||
|
@ -144,15 +132,6 @@ extern void miRecolorCursor(
|
|||
|
||||
/* midash.c */
|
||||
|
||||
extern miDashPtr miDashLine(
|
||||
int /*npt*/,
|
||||
DDXPointPtr /*ppt*/,
|
||||
unsigned int /*nDash*/,
|
||||
unsigned char * /*pDash*/,
|
||||
unsigned int /*offset*/,
|
||||
int * /*pnseg*/
|
||||
);
|
||||
|
||||
extern void miStepDash(
|
||||
int /*dist*/,
|
||||
int * /*pDashIndex*/,
|
||||
|
@ -326,16 +305,6 @@ extern void miPolySegment(
|
|||
|
||||
/* mipolytext.c */
|
||||
|
||||
extern int miPolyText(
|
||||
DrawablePtr /*pDraw*/,
|
||||
GCPtr /*pGC*/,
|
||||
int /*x*/,
|
||||
int /*y*/,
|
||||
int /*count*/,
|
||||
char * /*chars*/,
|
||||
FontEncoding /*fontEncoding*/
|
||||
);
|
||||
|
||||
extern int miPolyText8(
|
||||
DrawablePtr /*pDraw*/,
|
||||
GCPtr /*pGC*/,
|
||||
|
@ -354,16 +323,6 @@ extern int miPolyText16(
|
|||
unsigned short * /*chars*/
|
||||
);
|
||||
|
||||
extern int miImageText(
|
||||
DrawablePtr /*pDraw*/,
|
||||
GCPtr /*pGC*/,
|
||||
int /*x*/,
|
||||
int /*y*/,
|
||||
int /*count*/,
|
||||
char * /*chars*/,
|
||||
FontEncoding /*fontEncoding*/
|
||||
);
|
||||
|
||||
extern void miImageText8(
|
||||
DrawablePtr /*pDraw*/,
|
||||
GCPtr /*pGC*/,
|
||||
|
@ -403,10 +362,6 @@ extern Bool miRectAlloc(
|
|||
int /*n*/
|
||||
);
|
||||
|
||||
extern void miSetExtents(
|
||||
RegionPtr /*pReg*/
|
||||
);
|
||||
|
||||
extern int miFindMaxBand(
|
||||
RegionPtr /*prgn*/
|
||||
);
|
||||
|
@ -417,7 +372,6 @@ extern Bool miValidRegion(
|
|||
);
|
||||
#endif
|
||||
|
||||
extern Bool miRegionDataCopy(RegionPtr dst, RegionPtr src);
|
||||
extern Bool miRegionBroken(RegionPtr pReg);
|
||||
|
||||
/* miscrinit.c */
|
||||
|
@ -432,11 +386,6 @@ extern Bool miModifyPixmapHeader(
|
|||
pointer /*pPixData*/
|
||||
);
|
||||
|
||||
extern Bool miCloseScreen(
|
||||
int /*index*/,
|
||||
ScreenPtr /*pScreen*/
|
||||
);
|
||||
|
||||
extern Bool miCreateScreenResources(
|
||||
ScreenPtr /*pScreen*/
|
||||
);
|
||||
|
|
15
mi/miarc.c
15
mi/miarc.c
|
@ -425,15 +425,8 @@ 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;
|
||||
static int
|
||||
miFreeArcCache (pointer data, XID id)
|
||||
{
|
||||
int k;
|
||||
arcCacheRec *cent;
|
||||
|
@ -3136,8 +3129,8 @@ struct finalSpanChunk {
|
|||
|
||||
static struct finalSpanChunk *chunks;
|
||||
|
||||
struct finalSpan *
|
||||
realAllocSpan ()
|
||||
static struct finalSpan *
|
||||
realAllocSpan (void)
|
||||
{
|
||||
struct finalSpanChunk *newChunk;
|
||||
struct finalSpan *span;
|
||||
|
|
|
@ -400,13 +400,9 @@ miGetPlane(
|
|||
* Note how the clipped out bits of the bitmap are always the background
|
||||
* color so that the stipple never causes FillRect to draw them.
|
||||
*/
|
||||
void
|
||||
miOpqStipDrawable(pDraw, pGC, prgnSrc, pbits, srcx, w, h, dstx, dsty)
|
||||
DrawablePtr pDraw;
|
||||
GCPtr pGC;
|
||||
RegionPtr prgnSrc;
|
||||
MiBits *pbits;
|
||||
int srcx, w, h, dstx, dsty;
|
||||
static void
|
||||
miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
|
||||
MiBits *pbits, int srcx, int w, int h, int dstx, int dsty)
|
||||
{
|
||||
int oldfill, i;
|
||||
unsigned long oldfg;
|
||||
|
|
193
mi/midash.c
193
mi/midash.c
|
@ -54,196 +54,6 @@ SOFTWARE.
|
|||
|
||||
static miDashPtr CheckDashStorage(miDashPtr *ppseg, int nseg, int *pnsegMax);
|
||||
|
||||
/* return a list of DashRec. there will be an extra
|
||||
entry at the end holding the last point of the polyline.
|
||||
this means that the code that actually draws dashes can
|
||||
get a pair of points for every dash. only the point in the last
|
||||
dash record is useful; the other fields are not used.
|
||||
nseg is the number of segments, not the number of points.
|
||||
|
||||
example:
|
||||
|
||||
dash1.start
|
||||
dash2.start
|
||||
dash3.start
|
||||
last-point
|
||||
|
||||
defines a list of segments
|
||||
(dash1.pt, dash2.pt)
|
||||
(dash2.pt, dash3.pt)
|
||||
(dash3.pt, last-point)
|
||||
and nseg == 3.
|
||||
|
||||
NOTE:
|
||||
EVEN_DASH == ~ODD_DASH
|
||||
|
||||
NOTE ALSO:
|
||||
miDashLines may return 0 segments, going from pt[0] to pt[0] with one dash.
|
||||
*/
|
||||
|
||||
miDashPtr
|
||||
miDashLine(npt, ppt, nDash, pDash, offset, pnseg)
|
||||
int npt;
|
||||
DDXPointPtr ppt;
|
||||
unsigned int nDash;
|
||||
unsigned char *pDash;
|
||||
unsigned int offset;
|
||||
int *pnseg;
|
||||
{
|
||||
DDXPointRec pt1, pt2;
|
||||
int lenCur; /* npt used from this dash */
|
||||
int lenMax; /* npt in this dash */
|
||||
int iDash = 0; /* index of current dash */
|
||||
int which; /* EVEN_DASH or ODD_DASH */
|
||||
miDashPtr pseg; /* list of dash segments */
|
||||
miDashPtr psegBase; /* start of list */
|
||||
int nseg = 0; /* number of dashes so far */
|
||||
int nsegMax = 0; /* num segs we can fit in this list */
|
||||
|
||||
int x, y, len;
|
||||
int adx, ady, signdx, signdy;
|
||||
int du, dv, e1, e2, e, base_e = 0;
|
||||
|
||||
lenCur = offset;
|
||||
which = EVEN_DASH;
|
||||
while(lenCur >= pDash[iDash])
|
||||
{
|
||||
lenCur -= pDash[iDash];
|
||||
iDash++;
|
||||
if (iDash >= nDash)
|
||||
iDash = 0;
|
||||
which = ~which;
|
||||
}
|
||||
lenMax = pDash[iDash];
|
||||
|
||||
psegBase = (miDashPtr)NULL;
|
||||
pt2 = ppt[0]; /* just in case there is only one point */
|
||||
|
||||
while(--npt)
|
||||
{
|
||||
if (PtEqual(ppt[0], ppt[1]))
|
||||
{
|
||||
ppt++;
|
||||
continue; /* no duplicated points in polyline */
|
||||
}
|
||||
pt1 = *ppt++;
|
||||
pt2 = *ppt;
|
||||
|
||||
adx = pt2.x - pt1.x;
|
||||
ady = pt2.y - pt1.y;
|
||||
signdx = sign(adx);
|
||||
signdy = sign(ady);
|
||||
adx = abs(adx);
|
||||
ady = abs(ady);
|
||||
|
||||
if (adx > ady)
|
||||
{
|
||||
du = adx;
|
||||
dv = ady;
|
||||
len = adx;
|
||||
}
|
||||
else
|
||||
{
|
||||
du = ady;
|
||||
dv = adx;
|
||||
len = ady;
|
||||
}
|
||||
|
||||
e1 = dv * 2;
|
||||
e2 = e1 - 2*du;
|
||||
e = e1 - du;
|
||||
x = pt1.x;
|
||||
y = pt1.y;
|
||||
|
||||
nseg++;
|
||||
pseg = CheckDashStorage(&psegBase, nseg, &nsegMax);
|
||||
if (!pseg)
|
||||
return (miDashPtr)NULL;
|
||||
pseg->pt = pt1;
|
||||
pseg->e1 = e1;
|
||||
pseg->e2 = e2;
|
||||
base_e = pseg->e = e;
|
||||
pseg->which = which;
|
||||
pseg->newLine = 1;
|
||||
|
||||
while (len--)
|
||||
{
|
||||
if (adx > ady)
|
||||
{
|
||||
/* X_AXIS */
|
||||
if (((signdx > 0) && (e < 0)) ||
|
||||
((signdx <=0) && (e <=0))
|
||||
)
|
||||
{
|
||||
e += e1;
|
||||
}
|
||||
else
|
||||
{
|
||||
y += signdy;
|
||||
e += e2;
|
||||
}
|
||||
x += signdx;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Y_AXIS */
|
||||
if (((signdx > 0) && (e < 0)) ||
|
||||
((signdx <=0) && (e <=0))
|
||||
)
|
||||
{
|
||||
e +=e1;
|
||||
}
|
||||
else
|
||||
{
|
||||
x += signdx;
|
||||
e += e2;
|
||||
}
|
||||
y += signdy;
|
||||
}
|
||||
|
||||
lenCur++;
|
||||
if (lenCur >= lenMax && (len || npt <= 1))
|
||||
{
|
||||
nseg++;
|
||||
pseg = CheckDashStorage(&psegBase, nseg, &nsegMax);
|
||||
if (!pseg)
|
||||
return (miDashPtr)NULL;
|
||||
pseg->pt.x = x;
|
||||
pseg->pt.y = y;
|
||||
pseg->e1 = e1;
|
||||
pseg->e2 = e2;
|
||||
pseg->e = e;
|
||||
which = ~which;
|
||||
pseg->which = which;
|
||||
pseg->newLine = 0;
|
||||
|
||||
/* move on to next dash */
|
||||
iDash++;
|
||||
if (iDash >= nDash)
|
||||
iDash = 0;
|
||||
lenMax = pDash[iDash];
|
||||
lenCur = 0;
|
||||
}
|
||||
} /* while len-- */
|
||||
} /* while --npt */
|
||||
|
||||
if (lenCur == 0 && nseg != 0)
|
||||
{
|
||||
nseg--;
|
||||
which = ~which;
|
||||
}
|
||||
*pnseg = nseg;
|
||||
pseg = CheckDashStorage(&psegBase, nseg+1, &nsegMax);
|
||||
if (!pseg)
|
||||
return (miDashPtr)NULL;
|
||||
pseg->pt = pt2;
|
||||
pseg->e = base_e;
|
||||
pseg->which = which;
|
||||
pseg->newLine = 0;
|
||||
return psegBase;
|
||||
}
|
||||
|
||||
|
||||
#define NSEGDELTA 16
|
||||
|
||||
/* returns a pointer to the pseg[nseg-1], growing the storage as
|
||||
|
@ -251,8 +61,7 @@ necessary. this interface seems unnecessarily cumbersome.
|
|||
|
||||
*/
|
||||
|
||||
static
|
||||
miDashPtr
|
||||
static miDashPtr
|
||||
CheckDashStorage(
|
||||
miDashPtr *ppseg, /* base pointer */
|
||||
int nseg, /* number of segment we want to write to */
|
||||
|
|
|
@ -107,10 +107,8 @@ miFillArcSetup(arc, info)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
miFillArcDSetup(arc, info)
|
||||
xArc *arc;
|
||||
miFillArcDRec *info;
|
||||
static void
|
||||
miFillArcDSetup(xArc *arc, miFillArcDRec *info)
|
||||
{
|
||||
/* h^2 * (2x - 2xorg)^2 = w^2 * h^2 - w^2 * (2y - 2yorg)^2 */
|
||||
/* even: xorg = yorg = 0 odd: xorg = .5, yorg = -.5 */
|
||||
|
@ -188,15 +186,9 @@ miGetArcEdge(
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
miEllipseAngleToSlope (angle, width, height, dxp, dyp, d_dxp, d_dyp)
|
||||
int angle;
|
||||
int width;
|
||||
int height;
|
||||
int *dxp;
|
||||
int *dyp;
|
||||
double *d_dxp;
|
||||
double *d_dyp;
|
||||
static void
|
||||
miEllipseAngleToSlope (int angle, int width, int height, int *dxp, int *dyp,
|
||||
double *d_dxp, double *d_dyp)
|
||||
{
|
||||
int dx, dy;
|
||||
double d_dx, d_dy, scale;
|
||||
|
|
|
@ -176,35 +176,11 @@ typedef struct _miArcSlice {
|
|||
#define miFillInArcLower(slw) (((iny + dy) != 0) && \
|
||||
((slw > 1) || (ine != inxk)))
|
||||
|
||||
extern int miFreeArcCache(
|
||||
pointer /*data*/,
|
||||
XID /*id*/
|
||||
);
|
||||
|
||||
extern struct finalSpan *realAllocSpan(
|
||||
void
|
||||
);
|
||||
|
||||
extern void miFillArcSetup(
|
||||
xArc * /*arc*/,
|
||||
miFillArcRec * /*info*/
|
||||
);
|
||||
|
||||
extern void miFillArcDSetup(
|
||||
xArc * /*arc*/,
|
||||
miFillArcDRec * /*info*/
|
||||
);
|
||||
|
||||
extern void miEllipseAngleToSlope(
|
||||
int /*angle*/,
|
||||
int /*width*/,
|
||||
int /*height*/,
|
||||
int * /*dxp*/,
|
||||
int * /*dyp*/,
|
||||
double * /*d_dxp*/,
|
||||
double * /*d_dyp*/
|
||||
);
|
||||
|
||||
extern void miFillArcSliceSetup(
|
||||
xArc * /*arc*/,
|
||||
miArcSliceRec * /*slice*/,
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
/*
|
||||
* mipointer.c
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -409,6 +404,27 @@ miPointerAbsoluteCursor (int x, int y, unsigned long time)
|
|||
miPointerSetPosition(inputInfo.pointer, &x, &y, time);
|
||||
}
|
||||
|
||||
/* Move the pointer on the current screen, and update the sprite. */
|
||||
static void
|
||||
miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y,
|
||||
unsigned long time)
|
||||
{
|
||||
SetupScreen(pScreen);
|
||||
|
||||
if (pDev && (pDev->coreEvents || pDev == inputInfo.pointer) &&
|
||||
!pScreenPriv->waitForUpdate && pScreen == miPointer.pSpriteScreen)
|
||||
{
|
||||
miPointer.devx = x;
|
||||
miPointer.devy = y;
|
||||
if(!miPointer.pCursor->bits->emptyMask)
|
||||
(*pScreenPriv->spriteFuncs->MoveCursor) (pScreen, x, y);
|
||||
}
|
||||
|
||||
miPointer.x = x;
|
||||
miPointer.y = y;
|
||||
miPointer.pScreen = pScreen;
|
||||
}
|
||||
|
||||
_X_EXPORT void
|
||||
miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y, unsigned long time)
|
||||
{
|
||||
|
@ -499,24 +515,3 @@ miPointerMove (ScreenPtr pScreen, int x, int y, unsigned long time)
|
|||
for (i = 0; i < nevents; i++)
|
||||
mieqEnqueue(inputInfo.pointer, &events[i]);
|
||||
}
|
||||
|
||||
/* Move the pointer on the current screen, and update the sprite. */
|
||||
void
|
||||
miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y,
|
||||
unsigned long time)
|
||||
{
|
||||
SetupScreen(pScreen);
|
||||
|
||||
if (pDev && (pDev->coreEvents || pDev == inputInfo.pointer) &&
|
||||
!pScreenPriv->waitForUpdate && pScreen == miPointer.pSpriteScreen)
|
||||
{
|
||||
miPointer.devx = x;
|
||||
miPointer.devy = y;
|
||||
if(!miPointer.pCursor->bits->emptyMask)
|
||||
(*pScreenPriv->spriteFuncs->MoveCursor) (pScreen, x, y);
|
||||
}
|
||||
|
||||
miPointer.x = x;
|
||||
miPointer.y = y;
|
||||
miPointer.pScreen = pScreen;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
/*
|
||||
* mipointer.h
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -172,15 +166,6 @@ extern void miPointerSetPosition(
|
|||
extern void miPointerUpdateSprite(
|
||||
DeviceIntPtr pDev);
|
||||
|
||||
/* Moves the sprite to x, y on the current screen, and updates the event
|
||||
* history. */
|
||||
extern void miPointerMoved(
|
||||
DeviceIntPtr pDev,
|
||||
ScreenPtr pScreen,
|
||||
int x,
|
||||
int y,
|
||||
unsigned long time);
|
||||
|
||||
extern int miPointerScreenIndex;
|
||||
|
||||
#endif /* MIPOINTER_H */
|
||||
|
|
|
@ -180,14 +180,6 @@ typedef struct _ScanLineListBlock {
|
|||
|
||||
/* mipolyutil.c */
|
||||
|
||||
extern Bool miInsertEdgeInET(
|
||||
EdgeTable * /*ET*/,
|
||||
EdgeTableEntry * /*ETE*/,
|
||||
int /*scanline*/,
|
||||
ScanLineListBlock ** /*SLLBlock*/,
|
||||
int * /*iSLLBlock*/
|
||||
);
|
||||
|
||||
extern Bool miCreateETandAET(
|
||||
int /*count*/,
|
||||
DDXPointPtr /*pts*/,
|
||||
|
|
|
@ -66,30 +66,6 @@ SOFTWARE.
|
|||
#include "dixfontstr.h"
|
||||
#include "mi.h"
|
||||
|
||||
int
|
||||
miPolyText(pDraw, pGC, x, y, count, chars, fontEncoding)
|
||||
DrawablePtr pDraw;
|
||||
GCPtr pGC;
|
||||
int x, y;
|
||||
int count;
|
||||
char *chars;
|
||||
FontEncoding fontEncoding;
|
||||
{
|
||||
unsigned long n, i;
|
||||
int w;
|
||||
CharInfoPtr charinfo[255]; /* encoding only has 1 byte for count */
|
||||
|
||||
GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)chars,
|
||||
fontEncoding, &n, charinfo);
|
||||
w = 0;
|
||||
for (i=0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
|
||||
if (n != 0)
|
||||
(*pGC->ops->PolyGlyphBlt)(
|
||||
pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(pGC->font));
|
||||
return x+w;
|
||||
}
|
||||
|
||||
|
||||
_X_EXPORT int
|
||||
miPolyText8(pDraw, pGC, x, y, count, chars)
|
||||
DrawablePtr pDraw;
|
||||
|
@ -112,7 +88,6 @@ miPolyText8(pDraw, pGC, x, y, count, chars)
|
|||
return x+w;
|
||||
}
|
||||
|
||||
|
||||
_X_EXPORT int
|
||||
miPolyText16(pDraw, pGC, x, y, count, chars)
|
||||
DrawablePtr pDraw;
|
||||
|
@ -136,31 +111,6 @@ miPolyText16(pDraw, pGC, x, y, count, chars)
|
|||
return x+w;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
miImageText(pDraw, pGC, x, y, count, chars, fontEncoding)
|
||||
DrawablePtr pDraw;
|
||||
GCPtr pGC;
|
||||
int x, y;
|
||||
int count;
|
||||
char *chars;
|
||||
FontEncoding fontEncoding;
|
||||
{
|
||||
unsigned long n, i;
|
||||
FontPtr font = pGC->font;
|
||||
int w;
|
||||
CharInfoPtr charinfo[255];
|
||||
|
||||
GetGlyphs(font, (unsigned long)count, (unsigned char *)chars,
|
||||
fontEncoding, &n, charinfo);
|
||||
w = 0;
|
||||
for (i=0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
|
||||
if (n !=0 )
|
||||
(*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(font));
|
||||
return x+w;
|
||||
}
|
||||
|
||||
|
||||
_X_EXPORT void
|
||||
miImageText8(pDraw, pGC, x, y, count, chars)
|
||||
DrawablePtr pDraw;
|
||||
|
@ -179,7 +129,6 @@ miImageText8(pDraw, pGC, x, y, count, chars)
|
|||
(*pGC->ops->ImageGlyphBlt)(pDraw, pGC, x, y, n, charinfo, FONTGLYPHS(font));
|
||||
}
|
||||
|
||||
|
||||
_X_EXPORT void
|
||||
miImageText16(pDraw, pGC, x, y, count, chars)
|
||||
DrawablePtr pDraw;
|
||||
|
|
|
@ -73,13 +73,9 @@ SOFTWARE.
|
|||
* bucket. Finally, we can insert it.
|
||||
*
|
||||
*/
|
||||
Bool
|
||||
miInsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock)
|
||||
EdgeTable *ET;
|
||||
EdgeTableEntry *ETE;
|
||||
int scanline;
|
||||
ScanLineListBlock **SLLBlock;
|
||||
int *iSLLBlock;
|
||||
static Bool
|
||||
miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline,
|
||||
ScanLineListBlock **SLLBlock, int *iSLLBlock)
|
||||
{
|
||||
EdgeTableEntry *start, *prev;
|
||||
ScanLineList *pSLL, *pPrevSLL;
|
||||
|
|
|
@ -221,7 +221,7 @@ _X_EXPORT BoxRec miEmptyBox = {0, 0, 0, 0};
|
|||
_X_EXPORT RegDataRec miEmptyData = {0, 0};
|
||||
|
||||
RegDataRec miBrokenData = {0, 0};
|
||||
RegionRec miBrokenRegion = { { 0, 0, 0, 0 }, &miBrokenData };
|
||||
static RegionRec miBrokenRegion = { { 0, 0, 0, 0 }, &miBrokenData };
|
||||
|
||||
_X_EXPORT void
|
||||
miPrintRegion(rgn)
|
||||
|
@ -913,7 +913,7 @@ miRegionOp(
|
|||
*
|
||||
*-----------------------------------------------------------------------
|
||||
*/
|
||||
void
|
||||
static void
|
||||
miSetExtents (pReg)
|
||||
RegionPtr pReg;
|
||||
{
|
||||
|
@ -2182,35 +2182,6 @@ miTranslateRegion(pReg, x, y)
|
|||
}
|
||||
}
|
||||
|
||||
Bool
|
||||
miRegionDataCopy(
|
||||
RegionPtr dst,
|
||||
RegionPtr src)
|
||||
{
|
||||
good(dst);
|
||||
good(src);
|
||||
if (dst->data)
|
||||
return TRUE;
|
||||
if (dst == src)
|
||||
return TRUE;
|
||||
if (!src->data || !src->data->size)
|
||||
{
|
||||
xfreeData(dst);
|
||||
dst->data = (RegDataPtr)NULL;
|
||||
return TRUE;
|
||||
}
|
||||
if (!dst->data || (dst->data->size < src->data->numRects))
|
||||
{
|
||||
xfreeData(dst);
|
||||
dst->data = xallocData(src->data->numRects);
|
||||
if (!dst->data)
|
||||
return miRegionBreak (dst);
|
||||
}
|
||||
dst->data->size = src->data->size;
|
||||
dst->data->numRects = src->data->numRects;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
_X_EXPORT void
|
||||
miRegionReset(pReg, pBox)
|
||||
RegionPtr pReg;
|
||||
|
|
|
@ -126,12 +126,8 @@ miModifyPixmapHeader(pPixmap, width, height, depth, bitsPerPixel, devKind,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*ARGSUSED*/
|
||||
Bool
|
||||
miCloseScreen (iScreen, pScreen)
|
||||
int iScreen;
|
||||
ScreenPtr pScreen;
|
||||
static Bool
|
||||
miCloseScreen (int iScreen, ScreenPtr pScreen)
|
||||
{
|
||||
return ((*pScreen->DestroyPixmap)((PixmapPtr)pScreen->devPrivate));
|
||||
}
|
||||
|
|
30
mi/mispans.c
30
mi/mispans.c
|
@ -78,9 +78,7 @@ void miInitSpanGroup(spanGroup)
|
|||
#define YMIN(spans) (spans->points[0].y)
|
||||
#define YMAX(spans) (spans->points[spans->count-1].y)
|
||||
|
||||
void miSubtractSpans (spanGroup, sub)
|
||||
SpanGroup *spanGroup;
|
||||
Spans *sub;
|
||||
static void miSubtractSpans (SpanGroup *spanGroup, Spans *sub)
|
||||
{
|
||||
int i, subCount, spansCount;
|
||||
int ymin, ymax, xmin, xmax;
|
||||
|
@ -364,9 +362,8 @@ static int UniquifySpansX(
|
|||
return (newWidths - startNewWidths) + 1;
|
||||
} /* UniquifySpansX */
|
||||
|
||||
void
|
||||
miDisposeSpanGroup (spanGroup)
|
||||
SpanGroup *spanGroup;
|
||||
static void
|
||||
miDisposeSpanGroup (SpanGroup *spanGroup)
|
||||
{
|
||||
int i;
|
||||
Spans *spans;
|
||||
|
@ -538,24 +535,3 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup)
|
|||
spanGroup->ymin = MAXSHORT;
|
||||
spanGroup->ymax = MINSHORT;
|
||||
}
|
||||
|
||||
|
||||
void miFillSpanGroup(pDraw, pGC, spanGroup)
|
||||
DrawablePtr pDraw;
|
||||
GCPtr pGC;
|
||||
SpanGroup *spanGroup;
|
||||
{
|
||||
int i;
|
||||
Spans *spans;
|
||||
|
||||
for (i = 0, spans = spanGroup->group; i != spanGroup->count; i++, spans++) {
|
||||
(*pGC->ops->FillSpans)
|
||||
(pDraw, pGC, spans->count, spans->points, spans->widths, TRUE);
|
||||
xfree(spans->points);
|
||||
xfree(spans->widths);
|
||||
}
|
||||
|
||||
spanGroup->count = 0;
|
||||
spanGroup->ymin = MAXSHORT;
|
||||
spanGroup->ymax = MINSHORT;
|
||||
} /* FillSpanGroup */
|
||||
|
|
16
mi/mispans.h
16
mi/mispans.h
|
@ -71,13 +71,6 @@ extern void miAppendSpans(
|
|||
Spans * /*spans*/
|
||||
);
|
||||
|
||||
/* Paint a span group, possibly with some overlap */
|
||||
extern void miFillSpanGroup(
|
||||
DrawablePtr /*pDraw*/,
|
||||
GCPtr /*pGC*/,
|
||||
SpanGroup * /*spanGroup*/
|
||||
);
|
||||
|
||||
/* Paint a span group, insuring that each pixel is painted at most once */
|
||||
extern void miFillUniqueSpanGroup(
|
||||
DrawablePtr /*pDraw*/,
|
||||
|
@ -90,15 +83,6 @@ extern void miFreeSpanGroup(
|
|||
SpanGroup * /*spanGroup*/
|
||||
);
|
||||
|
||||
extern void miSubtractSpans(
|
||||
SpanGroup * /*spanGroup*/,
|
||||
Spans * /*sub*/
|
||||
);
|
||||
|
||||
extern void miDisposeSpanGroup(
|
||||
SpanGroup * /*spanGroup*/
|
||||
);
|
||||
|
||||
extern int miClipSpans(
|
||||
RegionPtr /*prgnDst*/,
|
||||
DDXPointPtr /*ppt*/,
|
||||
|
|
|
@ -67,17 +67,11 @@ static void miLineArc(DrawablePtr pDraw, GCPtr pGC,
|
|||
* spans-based polygon filler
|
||||
*/
|
||||
|
||||
void
|
||||
miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, overall_height,
|
||||
left, right, left_count, right_count)
|
||||
DrawablePtr pDrawable;
|
||||
GCPtr pGC;
|
||||
unsigned long pixel;
|
||||
SpanDataPtr spanData;
|
||||
int y; /* start y coordinate */
|
||||
int overall_height; /* height of entire segment */
|
||||
PolyEdgePtr left, right;
|
||||
int left_count, right_count;
|
||||
static void
|
||||
miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
|
||||
SpanDataPtr spanData, int y, int overall_height,
|
||||
PolyEdgePtr left, PolyEdgePtr right,
|
||||
int left_count, int right_count)
|
||||
{
|
||||
int left_x = 0, left_e = 0;
|
||||
int left_stepx = 0;
|
||||
|
@ -873,11 +867,8 @@ miLineArcD (
|
|||
return (pts - points);
|
||||
}
|
||||
|
||||
int
|
||||
miRoundJoinFace (face, edge, leftEdge)
|
||||
LineFacePtr face;
|
||||
PolyEdgePtr edge;
|
||||
Bool *leftEdge;
|
||||
static int
|
||||
miRoundJoinFace (LineFacePtr face, PolyEdgePtr edge, Bool *leftEdge)
|
||||
{
|
||||
int y;
|
||||
int dx, dy;
|
||||
|
@ -1114,16 +1105,10 @@ miLineArc (
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
miLineProjectingCap (pDrawable, pGC, pixel, spanData, face, isLeft, xorg, yorg, isInt)
|
||||
DrawablePtr pDrawable;
|
||||
GCPtr pGC;
|
||||
unsigned long pixel;
|
||||
SpanDataPtr spanData;
|
||||
LineFacePtr face;
|
||||
Bool isLeft;
|
||||
double xorg, yorg;
|
||||
Bool isInt;
|
||||
static void
|
||||
miLineProjectingCap (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
|
||||
SpanDataPtr spanData, LineFacePtr face, Bool isLeft,
|
||||
double xorg, double yorg, Bool isInt)
|
||||
{
|
||||
int xorgi = 0, yorgi = 0;
|
||||
int lw;
|
||||
|
@ -1506,11 +1491,8 @@ miWideSegment (
|
|||
}
|
||||
}
|
||||
|
||||
SpanDataPtr
|
||||
miSetupSpanData (pGC, spanData, npt)
|
||||
GCPtr pGC;
|
||||
SpanDataPtr spanData;
|
||||
int npt;
|
||||
static SpanDataPtr
|
||||
miSetupSpanData (GCPtr pGC, SpanDataPtr spanData, int npt)
|
||||
{
|
||||
if ((npt < 3 && pGC->capStyle != CapRound) || miSpansEasyRop(pGC->alu))
|
||||
return (SpanDataPtr) NULL;
|
||||
|
@ -1520,11 +1502,8 @@ miSetupSpanData (pGC, spanData, npt)
|
|||
return spanData;
|
||||
}
|
||||
|
||||
void
|
||||
miCleanupSpanData (pDrawable, pGC, spanData)
|
||||
DrawablePtr pDrawable;
|
||||
GCPtr pGC;
|
||||
SpanDataPtr spanData;
|
||||
static void
|
||||
miCleanupSpanData (DrawablePtr pDrawable, GCPtr pGC, SpanDataPtr spanData)
|
||||
{
|
||||
if (pGC->lineStyle == LineDoubleDash)
|
||||
{
|
||||
|
|
|
@ -153,24 +153,6 @@ typedef struct _LineFace {
|
|||
} \
|
||||
}
|
||||
|
||||
extern void miFillPolyHelper(
|
||||
DrawablePtr /*pDrawable*/,
|
||||
GCPtr /*pGC*/,
|
||||
unsigned long /*pixel*/,
|
||||
SpanDataPtr /*spanData*/,
|
||||
int /*y*/,
|
||||
int /*overall_height*/,
|
||||
PolyEdgePtr /*left*/,
|
||||
PolyEdgePtr /*right*/,
|
||||
int /*left_count*/,
|
||||
int /*right_count*/
|
||||
);
|
||||
extern int miRoundJoinFace(
|
||||
LineFacePtr /*face*/,
|
||||
PolyEdgePtr /*edge*/,
|
||||
Bool * /*leftEdge*/
|
||||
);
|
||||
|
||||
extern void miRoundJoinClip(
|
||||
LineFacePtr /*pLeft*/,
|
||||
LineFacePtr /*pRight*/,
|
||||
|
@ -189,30 +171,6 @@ extern int miRoundCapClip(
|
|||
Bool * /*leftEdge*/
|
||||
);
|
||||
|
||||
extern void miLineProjectingCap(
|
||||
DrawablePtr /*pDrawable*/,
|
||||
GCPtr /*pGC*/,
|
||||
unsigned long /*pixel*/,
|
||||
SpanDataPtr /*spanData*/,
|
||||
LineFacePtr /*face*/,
|
||||
Bool /*isLeft*/,
|
||||
double /*xorg*/,
|
||||
double /*yorg*/,
|
||||
Bool /*isInt*/
|
||||
);
|
||||
|
||||
extern SpanDataPtr miSetupSpanData(
|
||||
GCPtr /*pGC*/,
|
||||
SpanDataPtr /*spanData*/,
|
||||
int /*npt*/
|
||||
);
|
||||
|
||||
extern void miCleanupSpanData(
|
||||
DrawablePtr /*pDrawable*/,
|
||||
GCPtr /*pGC*/,
|
||||
SpanDataPtr /*spanData*/
|
||||
);
|
||||
|
||||
extern int miPolyBuildEdge(double x0, double y0, double k, int dx, int dy,
|
||||
int xi, int yi, int left, PolyEdgePtr edge);
|
||||
extern int miPolyBuildPoly(PolyVertexPtr vertices, PolySlopePtr slopes,
|
||||
|
|
|
@ -401,10 +401,8 @@ miZeroArcSetup(arc, info, ok360)
|
|||
|
||||
#define DoPix(idx,xval,yval) if (mask & (1 << idx)) Pixelate(xval, yval);
|
||||
|
||||
DDXPointPtr
|
||||
miZeroArcPts(arc, pts)
|
||||
xArc *arc;
|
||||
DDXPointPtr pts;
|
||||
static DDXPointPtr
|
||||
miZeroArcPts(xArc *arc, DDXPointPtr pts)
|
||||
{
|
||||
miZeroArcRec info;
|
||||
int x, y, a, b, d, mask;
|
||||
|
|
|
@ -124,9 +124,3 @@ extern Bool miZeroArcSetup(
|
|||
miZeroArcRec * /*info*/,
|
||||
Bool /*ok360*/
|
||||
);
|
||||
|
||||
extern DDXPointPtr miZeroArcPts(
|
||||
xArc * /*arc*/,
|
||||
DDXPointPtr /*pts*/
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue