Change region implementation names to eliminate the 'mi' prefix

This prepares the file to be moved from mi to dix. This patch
was done mechanically with the included scripts 'fix-miregion' run over
the entire X server and 'fix-miregion-private' run over
include/regionstr.h and mi/miregion.c.

Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard 2010-05-21 11:14:59 -07:00
parent 1768e51976
commit 9b6f5f549d
10 changed files with 192 additions and 149 deletions

View File

@ -195,7 +195,7 @@ PrintChildren(WindowPtr p1, int indent)
ErrorF("[dix] "); ErrorF("[dix] ");
for (i=0; i<indent; i++) ErrorF(" "); for (i=0; i<indent; i++) ErrorF(" ");
ErrorF("%lx\n", p1->drawable.id); ErrorF("%lx\n", p1->drawable.id);
miPrintRegion(&p1->clipList); RegionPrint(&p1->clipList);
PrintChildren(p2, indent+4); PrintChildren(p2, indent+4);
p1 = p1->nextSib; p1 = p1->nextSib;
} }
@ -211,7 +211,7 @@ PrintWindowTree(void)
{ {
ErrorF("[dix] WINDOW %d\n", i); ErrorF("[dix] WINDOW %d\n", i);
pWin = screenInfo.screens[i]->root; pWin = screenInfo.screens[i]->root;
miPrintRegion(&pWin->clipList); RegionPrint(&pWin->clipList);
p1 = pWin->firstChild; p1 = pWin->firstChild;
PrintChildren(p1, 4); PrintChildren(p1, 4);
} }

View File

@ -407,7 +407,7 @@ exaHWCopyNtoN (DrawablePtr pSrcDrawable,
rects[i].height = pbox[i].y2 - pbox[i].y1; rects[i].height = pbox[i].y2 - pbox[i].y1;
} }
/* This must match the miRegionCopy() logic for reversing rect order */ /* This must match the RegionCopy() logic for reversing rect order */
if (nbox == 1 || (dx > 0 && dy > 0) || if (nbox == 1 || (dx > 0 && dy > 0) ||
(pDstDrawable != pSrcDrawable && (pDstDrawable != pSrcDrawable &&
(pDstDrawable->type != DRAWABLE_WINDOW || (pDstDrawable->type != DRAWABLE_WINDOW ||

View File

@ -115,7 +115,7 @@ if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \
{ \ { \
if ((reg)->data->numRects == (reg)->data->size) \ if ((reg)->data->numRects == (reg)->data->size) \
{ \ { \
miRectAlloc(reg, 1); \ RegionRectAlloc(reg, 1); \
fr = REGION_BOXPTR(reg); \ fr = REGION_BOXPTR(reg); \
r = fr + (reg)->data->numRects; \ r = fr + (reg)->data->numRects; \
} \ } \
@ -315,7 +315,7 @@ fbPixmapToRegion(PixmapPtr pPix)
fbFinishAccess(&pPix->drawable); fbFinishAccess(&pPix->drawable);
#ifdef DEBUG #ifdef DEBUG
if (!miValidRegion(pReg)) if (!RegionIsValid(pReg))
FatalError("Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__); FatalError("Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__);
#endif #endif
return(pReg); return(pReg);

29
fix-miregion Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
sed -i \
-e 's/miRegionCreate\b/RegionCreate/g' \
-e 's/miRegionInit\b/RegionInit/g' \
-e 's/miRegionDestroy\b/RegionDestroy/g' \
-e 's/miRegionUninit\b/RegionUninit/g' \
-e 's/miRegionCopy\b/RegionCopy/g' \
-e 's/miIntersect\b/RegionIntersect/g' \
-e 's/miUnion\b/RegionUnion/g' \
-e 's/miRegionAppend\b/RegionAppend/g' \
-e 's/miRegionValidate\b/RegionValidate/g' \
-e 's/miRectsToRegion\b/RegionFromRects/g' \
-e 's/miSubtract\b/RegionSubtract/g' \
-e 's/miInverse\b/RegionInverse/g' \
-e 's/miRectIn\b/RegionContainsRect/g' \
-e 's/miTranslateRegion\b/RegionTranslate/g' \
-e 's/miRegionReset\b/RegionReset/g' \
-e 's/miRegionBreak\b/RegionBreak/g' \
-e 's/miPointInRegion\b/RegionContainsPoint/g' \
-e 's/miRegionEqual\b/RegionEqual/g' \
-e 's/miRegionNotEmpty\b/RegionNotEmpty/g' \
-e 's/miRegionEmpty\b/RegionEmpty/g' \
-e 's/miRegionExtents\b/RegionExtents/g' \
-e 's/miPrintRegion\b/RegionPrint/g' \
-e 's/miRectAlloc\b/RegionRectAlloc/g' \
-e 's/miValidRegion\b/RegionIsValid/g' \
-e 's/miRegionBroken\b/RegionBroken/g' \
-e 's/miClipSpans\b/RegionClipSpans/g' \
"$@"

14
fix-miregion-private Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
sed -i \
-e 's/miEmptyBox\b/RegionEmptyBox/g' \
-e 's/miEmptyData\b/RegionEmptyData/g' \
-e 's/miBrokenData\b/RegionBrokenData/g' \
-e 's/miBrokenRegion\b/RegionBrokenRegion/g' \
-e 's/miCoalesce\b/RegionCoalesce/g' \
-e 's/miAppendNonO\b/RegionAppendNonO/g' \
-e 's/miRegionOp\b/RegionOp/g' \
-e 's/miSetExtents\b/RegionSetExtents/g' \
-e 's/miIntersectO\b/RegionIntersectO/g' \
-e 's/miUnionO\b/RegionUnionO/g' \
-e 's/miSubtractO\b/RegionSubtractO/g' \
"$@"

View File

@ -66,13 +66,13 @@ typedef struct pixman_region16 RegionRec, *RegionPtr;
typedef struct pixman_region16_data RegDataRec, *RegDataPtr; typedef struct pixman_region16_data RegDataRec, *RegDataPtr;
extern _X_EXPORT BoxRec miEmptyBox; extern _X_EXPORT BoxRec RegionEmptyBox;
extern _X_EXPORT RegDataRec miEmptyData; extern _X_EXPORT RegDataRec RegionEmptyData;
extern _X_EXPORT RegDataRec miBrokenData; extern _X_EXPORT RegDataRec RegionBrokenData;
#define REGION_NIL(reg) ((reg)->data && !(reg)->data->numRects) #define REGION_NIL(reg) ((reg)->data && !(reg)->data->numRects)
/* not a region */ /* not a region */
#define REGION_NAR(reg) ((reg)->data == &miBrokenData) #define REGION_NAR(reg) ((reg)->data == &RegionBrokenData)
#define REGION_NUM_RECTS(reg) ((reg)->data ? (reg)->data->numRects : 1) #define REGION_NUM_RECTS(reg) ((reg)->data ? (reg)->data->numRects : 1)
#define REGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0) #define REGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0)
#define REGION_RECTS(reg) ((reg)->data ? (BoxPtr)((reg)->data + 1) \ #define REGION_RECTS(reg) ((reg)->data ? (BoxPtr)((reg)->data + 1) \
@ -84,52 +84,52 @@ extern _X_EXPORT RegDataRec miBrokenData;
#define REGION_SZOF(n) (sizeof(RegDataRec) + ((n) * sizeof(BoxRec))) #define REGION_SZOF(n) (sizeof(RegDataRec) + ((n) * sizeof(BoxRec)))
#define REGION_CREATE(_pScreen, _rect, _size) \ #define REGION_CREATE(_pScreen, _rect, _size) \
miRegionCreate(_rect, _size) RegionCreate(_rect, _size)
#define REGION_COPY(_pScreen, dst, src) \ #define REGION_COPY(_pScreen, dst, src) \
miRegionCopy(dst, src) RegionCopy(dst, src)
#define REGION_DESTROY(_pScreen, _pReg) \ #define REGION_DESTROY(_pScreen, _pReg) \
miRegionDestroy(_pReg) RegionDestroy(_pReg)
#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \ #define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \
miIntersect(newReg, reg1, reg2) RegionIntersect(newReg, reg1, reg2)
#define REGION_UNION(_pScreen, newReg, reg1, reg2) \ #define REGION_UNION(_pScreen, newReg, reg1, reg2) \
miUnion(newReg, reg1, reg2) RegionUnion(newReg, reg1, reg2)
#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \ #define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \
miSubtract(newReg, reg1, reg2) RegionSubtract(newReg, reg1, reg2)
#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \ #define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \
miInverse(newReg, reg1, invRect) RegionInverse(newReg, reg1, invRect)
#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \ #define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \
miTranslateRegion(_pReg, _x, _y) RegionTranslate(_pReg, _x, _y)
#define RECT_IN_REGION(_pScreen, _pReg, prect) \ #define RECT_IN_REGION(_pScreen, _pReg, prect) \
miRectIn(_pReg, prect) RegionContainsRect(_pReg, prect)
#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \ #define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \
miPointInRegion(_pReg, _x, _y, prect) RegionContainsPoint(_pReg, _x, _y, prect)
#define REGION_APPEND(_pScreen, dstrgn, rgn) \ #define REGION_APPEND(_pScreen, dstrgn, rgn) \
miRegionAppend(dstrgn, rgn) RegionAppend(dstrgn, rgn)
#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \ #define REGION_VALIDATE(_pScreen, badreg, pOverlap) \
miRegionValidate(badreg, pOverlap) RegionValidate(badreg, pOverlap)
#define BITMAP_TO_REGION(_pScreen, pPix) \ #define BITMAP_TO_REGION(_pScreen, pPix) \
(*(_pScreen)->BitmapToRegion)(pPix) /* no mi version?! */ (*(_pScreen)->BitmapToRegion)(pPix) /* no mi version?! */
#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \ #define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \
miRectsToRegion(nrects, prect, ctype) RegionFromRects(nrects, prect, ctype)
#define REGION_EQUAL(_pScreen, _pReg1, _pReg2) \ #define REGION_EQUAL(_pScreen, _pReg1, _pReg2) \
miRegionEqual(_pReg1, _pReg2) RegionEqual(_pReg1, _pReg2)
#define REGION_BREAK(_pScreen, _pReg) \ #define REGION_BREAK(_pScreen, _pReg) \
miRegionBreak(_pReg) RegionBreak(_pReg)
#define REGION_INIT(_pScreen, _pReg, _rect, _size) \ #define REGION_INIT(_pScreen, _pReg, _rect, _size) \
{ \ { \
@ -140,7 +140,7 @@ extern _X_EXPORT RegDataRec miBrokenData;
} \ } \
else \ else \
{ \ { \
(_pReg)->extents = miEmptyBox; \ (_pReg)->extents = RegionEmptyBox; \
if (((_size) > 1) && ((_pReg)->data = \ if (((_size) > 1) && ((_pReg)->data = \
(RegDataPtr)malloc(REGION_SZOF(_size)))) \ (RegDataPtr)malloc(REGION_SZOF(_size)))) \
{ \ { \
@ -148,7 +148,7 @@ extern _X_EXPORT RegDataRec miBrokenData;
(_pReg)->data->numRects = 0; \ (_pReg)->data->numRects = 0; \
} \ } \
else \ else \
(_pReg)->data = &miEmptyData; \ (_pReg)->data = &RegionEmptyData; \
} \ } \
} }
@ -179,7 +179,7 @@ extern _X_EXPORT RegDataRec miBrokenData;
REGION_UNINIT(_pScreen, _pReg); \ REGION_UNINIT(_pScreen, _pReg); \
(_pReg)->extents.x2 = (_pReg)->extents.x1; \ (_pReg)->extents.x2 = (_pReg)->extents.x1; \
(_pReg)->extents.y2 = (_pReg)->extents.y1; \ (_pReg)->extents.y2 = (_pReg)->extents.y1; \
(_pReg)->data = &miEmptyData; \ (_pReg)->data = &RegionEmptyData; \
} }
#define REGION_EXTENTS(_pScreen, _pReg) \ #define REGION_EXTENTS(_pScreen, _pReg) \
@ -187,8 +187,8 @@ extern _X_EXPORT RegDataRec miBrokenData;
#define REGION_NULL(_pScreen, _pReg) \ #define REGION_NULL(_pScreen, _pReg) \
{ \ { \
(_pReg)->extents = miEmptyBox; \ (_pReg)->extents = RegionEmptyBox; \
(_pReg)->data = &miEmptyData; \ (_pReg)->data = &RegionEmptyData; \
} }
#ifndef REGION_NULL #ifndef REGION_NULL
@ -200,94 +200,94 @@ extern _X_EXPORT RegDataRec miBrokenData;
extern _X_EXPORT void InitRegions (void); extern _X_EXPORT void InitRegions (void);
extern _X_EXPORT RegionPtr miRegionCreate( extern _X_EXPORT RegionPtr RegionCreate(
BoxPtr /*rect*/, BoxPtr /*rect*/,
int /*size*/); int /*size*/);
extern _X_EXPORT void miRegionInit( extern _X_EXPORT void RegionInit(
RegionPtr /*pReg*/, RegionPtr /*pReg*/,
BoxPtr /*rect*/, BoxPtr /*rect*/,
int /*size*/); int /*size*/);
extern _X_EXPORT void miRegionDestroy( extern _X_EXPORT void RegionDestroy(
RegionPtr /*pReg*/); RegionPtr /*pReg*/);
extern _X_EXPORT void miRegionUninit( extern _X_EXPORT void RegionUninit(
RegionPtr /*pReg*/); RegionPtr /*pReg*/);
extern _X_EXPORT Bool miRegionCopy( extern _X_EXPORT Bool RegionCopy(
RegionPtr /*dst*/, RegionPtr /*dst*/,
RegionPtr /*src*/); RegionPtr /*src*/);
extern _X_EXPORT Bool miIntersect( extern _X_EXPORT Bool RegionIntersect(
RegionPtr /*newReg*/, RegionPtr /*newReg*/,
RegionPtr /*reg1*/, RegionPtr /*reg1*/,
RegionPtr /*reg2*/); RegionPtr /*reg2*/);
extern _X_EXPORT Bool miUnion( extern _X_EXPORT Bool RegionUnion(
RegionPtr /*newReg*/, RegionPtr /*newReg*/,
RegionPtr /*reg1*/, RegionPtr /*reg1*/,
RegionPtr /*reg2*/); RegionPtr /*reg2*/);
extern _X_EXPORT Bool miRegionAppend( extern _X_EXPORT Bool RegionAppend(
RegionPtr /*dstrgn*/, RegionPtr /*dstrgn*/,
RegionPtr /*rgn*/); RegionPtr /*rgn*/);
extern _X_EXPORT Bool miRegionValidate( extern _X_EXPORT Bool RegionValidate(
RegionPtr /*badreg*/, RegionPtr /*badreg*/,
Bool * /*pOverlap*/); Bool * /*pOverlap*/);
extern _X_EXPORT RegionPtr miRectsToRegion( extern _X_EXPORT RegionPtr RegionFromRects(
int /*nrects*/, int /*nrects*/,
xRectanglePtr /*prect*/, xRectanglePtr /*prect*/,
int /*ctype*/); int /*ctype*/);
extern _X_EXPORT Bool miSubtract( extern _X_EXPORT Bool RegionSubtract(
RegionPtr /*regD*/, RegionPtr /*regD*/,
RegionPtr /*regM*/, RegionPtr /*regM*/,
RegionPtr /*regS*/); RegionPtr /*regS*/);
extern _X_EXPORT Bool miInverse( extern _X_EXPORT Bool RegionInverse(
RegionPtr /*newReg*/, RegionPtr /*newReg*/,
RegionPtr /*reg1*/, RegionPtr /*reg1*/,
BoxPtr /*invRect*/); BoxPtr /*invRect*/);
extern _X_EXPORT int miRectIn( extern _X_EXPORT int RegionContainsRect(
RegionPtr /*region*/, RegionPtr /*region*/,
BoxPtr /*prect*/); BoxPtr /*prect*/);
extern _X_EXPORT void miTranslateRegion( extern _X_EXPORT void RegionTranslate(
RegionPtr /*pReg*/, RegionPtr /*pReg*/,
int /*x*/, int /*x*/,
int /*y*/); int /*y*/);
extern _X_EXPORT void miRegionReset( extern _X_EXPORT void RegionReset(
RegionPtr /*pReg*/, RegionPtr /*pReg*/,
BoxPtr /*pBox*/); BoxPtr /*pBox*/);
extern _X_EXPORT Bool miRegionBreak( extern _X_EXPORT Bool RegionBreak(
RegionPtr /*pReg*/); RegionPtr /*pReg*/);
extern _X_EXPORT Bool miPointInRegion( extern _X_EXPORT Bool RegionContainsPoint(
RegionPtr /*pReg*/, RegionPtr /*pReg*/,
int /*x*/, int /*x*/,
int /*y*/, int /*y*/,
BoxPtr /*box*/); BoxPtr /*box*/);
extern _X_EXPORT Bool miRegionEqual( extern _X_EXPORT Bool RegionEqual(
RegionPtr /*pReg1*/, RegionPtr /*pReg1*/,
RegionPtr /*pReg2*/); RegionPtr /*pReg2*/);
extern _X_EXPORT Bool miRegionNotEmpty( extern _X_EXPORT Bool RegionNotEmpty(
RegionPtr /*pReg*/); RegionPtr /*pReg*/);
extern _X_EXPORT void miRegionEmpty( extern _X_EXPORT void RegionEmpty(
RegionPtr /*pReg*/); RegionPtr /*pReg*/);
extern _X_EXPORT BoxPtr miRegionExtents( extern _X_EXPORT BoxPtr RegionExtents(
RegionPtr /*pReg*/); RegionPtr /*pReg*/);
extern _X_EXPORT void miPrintRegion( extern _X_EXPORT void RegionPrint(
RegionPtr /*pReg*/); RegionPtr /*pReg*/);
#endif /* REGIONSTRUCT_H */ #endif /* REGIONSTRUCT_H */

View File

@ -422,18 +422,18 @@ extern _X_EXPORT void miPushPixels(
/* see also region.h */ /* see also region.h */
extern _X_EXPORT Bool miRectAlloc( extern _X_EXPORT Bool RegionRectAlloc(
RegionPtr /*pRgn*/, RegionPtr /*pRgn*/,
int /*n*/ int /*n*/
); );
#ifdef DEBUG #ifdef DEBUG
extern _X_EXPORT Bool miValidRegion( extern _X_EXPORT Bool RegionIsValid(
RegionPtr /*prgn*/ RegionPtr /*prgn*/
); );
#endif #endif
extern _X_EXPORT Bool miRegionBroken(RegionPtr pReg); extern _X_EXPORT Bool RegionBroken(RegionPtr pReg);
/* miscrinit.c */ /* miscrinit.c */

View File

@ -101,7 +101,7 @@ Equipment Corporation.
#define assert(expr) #define assert(expr)
#endif #endif
#define good(reg) assert(miValidRegion(reg)) #define good(reg) assert(RegionIsValid(reg))
/* /*
* The functions in this file implement the Region abstraction used extensively * The functions in this file implement the Region abstraction used extensively
@ -144,7 +144,7 @@ Equipment Corporation.
* *
* Adam de Boor wrote most of the original region code. Joel McCormack * Adam de Boor wrote most of the original region code. Joel McCormack
* substantially modified or rewrote most of the core arithmetic routines, * substantially modified or rewrote most of the core arithmetic routines,
* and added miRegionValidate in order to support several speed improvements * and added RegionValidate in order to support several speed improvements
* to miValidateTree. Bob Scheifler changed the representation to be more * to miValidateTree. Bob Scheifler changed the representation to be more
* compact when empty or a single rectangle, and did a bunch of gratuitous * compact when empty or a single rectangle, and did a bunch of gratuitous
* reformatting. * reformatting.
@ -176,11 +176,11 @@ Equipment Corporation.
#define RECTALLOC_BAIL(pReg,n,bail) \ #define RECTALLOC_BAIL(pReg,n,bail) \
if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
if (!miRectAlloc(pReg, n)) { goto bail; } if (!RegionRectAlloc(pReg, n)) { goto bail; }
#define RECTALLOC(pReg,n) \ #define RECTALLOC(pReg,n) \
if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
if (!miRectAlloc(pReg, n)) { return FALSE; } if (!RegionRectAlloc(pReg, n)) { return FALSE; }
#define ADDRECT(pNextRect,nx1,ny1,nx2,ny2) \ #define ADDRECT(pNextRect,nx1,ny1,nx2,ny2) \
{ \ { \
@ -195,7 +195,7 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
{ \ { \
if (!(pReg)->data || ((pReg)->data->numRects == (pReg)->data->size))\ if (!(pReg)->data || ((pReg)->data->numRects == (pReg)->data->size))\
{ \ { \
if (!miRectAlloc(pReg, 1)) \ if (!RegionRectAlloc(pReg, 1)) \
return FALSE; \ return FALSE; \
pNextRect = REGION_TOP(pReg); \ pNextRect = REGION_TOP(pReg); \
} \ } \
@ -218,16 +218,16 @@ if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \
} }
BoxRec miEmptyBox = {0, 0, 0, 0}; BoxRec RegionEmptyBox = {0, 0, 0, 0};
RegDataRec miEmptyData = {0, 0}; RegDataRec RegionEmptyData = {0, 0};
RegDataRec miBrokenData = {0, 0}; RegDataRec RegionBrokenData = {0, 0};
static RegionRec miBrokenRegion = { { 0, 0, 0, 0 }, &miBrokenData }; static RegionRec RegionBrokenRegion = { { 0, 0, 0, 0 }, &RegionBrokenData };
void void
InitRegions (void) InitRegions (void)
{ {
pixman_region_set_static_pointers (&miEmptyBox, &miEmptyData, &miBrokenData); pixman_region_set_static_pointers (&RegionEmptyBox, &RegionEmptyData, &RegionBrokenData);
} }
/***************************************************************** /*****************************************************************
@ -237,29 +237,29 @@ InitRegions (void)
*****************************************************************/ *****************************************************************/
RegionPtr RegionPtr
miRegionCreate(BoxPtr rect, int size) RegionCreate(BoxPtr rect, int size)
{ {
RegionPtr pReg; RegionPtr pReg;
pReg = (RegionPtr)malloc(sizeof(RegionRec)); pReg = (RegionPtr)malloc(sizeof(RegionRec));
if (!pReg) if (!pReg)
return &miBrokenRegion; return &RegionBrokenRegion;
miRegionInit (pReg, rect, size); RegionInit (pReg, rect, size);
return(pReg); return(pReg);
} }
void void
miRegionDestroy(RegionPtr pReg) RegionDestroy(RegionPtr pReg)
{ {
pixman_region_fini (pReg); pixman_region_fini (pReg);
if (pReg != &miBrokenRegion) if (pReg != &RegionBrokenRegion)
free(pReg); free(pReg);
} }
void void
miPrintRegion(RegionPtr rgn) RegionPrint(RegionPtr rgn)
{ {
int num, size; int num, size;
int i; int i;
@ -278,14 +278,14 @@ miPrintRegion(RegionPtr rgn)
} }
Bool Bool
miRegionEqual(RegionPtr reg1, RegionPtr reg2) RegionEqual(RegionPtr reg1, RegionPtr reg2)
{ {
return pixman_region_equal (reg1, reg2); return pixman_region_equal (reg1, reg2);
} }
#ifdef DEBUG #ifdef DEBUG
Bool Bool
miValidRegion(RegionPtr reg) RegionIsValid(RegionPtr reg)
{ {
int i, numRects; int i, numRects;
@ -296,7 +296,7 @@ miValidRegion(RegionPtr reg)
if (!numRects) if (!numRects)
return ((reg->extents.x1 == reg->extents.x2) && return ((reg->extents.x1 == reg->extents.x2) &&
(reg->extents.y1 == reg->extents.y2) && (reg->extents.y1 == reg->extents.y2) &&
(reg->data->size || (reg->data == &miEmptyData))); (reg->data->size || (reg->data == &RegionEmptyData)));
else if (numRects == 1) else if (numRects == 1)
return (!reg->data); return (!reg->data);
else else
@ -336,7 +336,7 @@ miValidRegion(RegionPtr reg)
*****************************************************************/ *****************************************************************/
void void
miRegionInit(RegionPtr pReg, BoxPtr rect, int size) RegionInit(RegionPtr pReg, BoxPtr rect, int size)
{ {
if (rect) if (rect)
pixman_region_init_with_extents (pReg, rect); pixman_region_init_with_extents (pReg, rect);
@ -345,22 +345,22 @@ miRegionInit(RegionPtr pReg, BoxPtr rect, int size)
} }
void void
miRegionUninit(RegionPtr pReg) RegionUninit(RegionPtr pReg)
{ {
pixman_region_fini (pReg); pixman_region_fini (pReg);
} }
Bool Bool
miRegionBreak (RegionPtr pReg) RegionBreak (RegionPtr pReg)
{ {
xfreeData (pReg); xfreeData (pReg);
pReg->extents = miEmptyBox; pReg->extents = RegionEmptyBox;
pReg->data = &miBrokenData; pReg->data = &RegionBrokenData;
return FALSE; return FALSE;
} }
Bool Bool
miRectAlloc(RegionPtr pRgn, int n) RegionRectAlloc(RegionPtr pRgn, int n)
{ {
RegDataPtr data; RegDataPtr data;
@ -369,7 +369,7 @@ miRectAlloc(RegionPtr pRgn, int n)
n++; n++;
pRgn->data = xallocData(n); pRgn->data = xallocData(n);
if (!pRgn->data) if (!pRgn->data)
return miRegionBreak (pRgn); return RegionBreak (pRgn);
pRgn->data->numRects = 1; pRgn->data->numRects = 1;
*REGION_BOXPTR(pRgn) = pRgn->extents; *REGION_BOXPTR(pRgn) = pRgn->extents;
} }
@ -377,7 +377,7 @@ miRectAlloc(RegionPtr pRgn, int n)
{ {
pRgn->data = xallocData(n); pRgn->data = xallocData(n);
if (!pRgn->data) if (!pRgn->data)
return miRegionBreak (pRgn); return RegionBreak (pRgn);
pRgn->data->numRects = 0; pRgn->data->numRects = 0;
} }
else else
@ -391,7 +391,7 @@ miRectAlloc(RegionPtr pRgn, int n)
n += pRgn->data->numRects; n += pRgn->data->numRects;
data = (RegDataPtr)realloc(pRgn->data, REGION_SZOF(n)); data = (RegDataPtr)realloc(pRgn->data, REGION_SZOF(n));
if (!data) if (!data)
return miRegionBreak (pRgn); return RegionBreak (pRgn);
pRgn->data = data; pRgn->data = data;
} }
pRgn->data->size = n; pRgn->data->size = n;
@ -399,7 +399,7 @@ miRectAlloc(RegionPtr pRgn, int n)
} }
Bool Bool
miRegionCopy(RegionPtr dst, RegionPtr src) RegionCopy(RegionPtr dst, RegionPtr src)
{ {
return pixman_region_copy (dst, src); return pixman_region_copy (dst, src);
} }
@ -410,10 +410,10 @@ miRegionCopy(RegionPtr dst, RegionPtr src)
/*- /*-
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
* miCoalesce -- * RegionCoalesce --
* Attempt to merge the boxes in the current band with those in the * Attempt to merge the boxes in the current band with those in the
* previous one. We are guaranteed that the current band extends to * previous one. We are guaranteed that the current band extends to
* the end of the rects array. Used only by miRegionOp. * the end of the rects array. Used only by RegionOp.
* *
* Results: * Results:
* The new index for the previous band. * The new index for the previous band.
@ -427,7 +427,7 @@ miRegionCopy(RegionPtr dst, RegionPtr src)
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
*/ */
_X_INLINE static int _X_INLINE static int
miCoalesce ( RegionCoalesce (
RegionPtr pReg, /* Region to coalesce */ RegionPtr pReg, /* Region to coalesce */
int prevStart, /* Index of start of previous band */ int prevStart, /* Index of start of previous band */
int curStart) /* Index of start of current band */ int curStart) /* Index of start of current band */
@ -484,18 +484,18 @@ miCoalesce (
} }
/* Quicky macro to avoid trivial reject procedure calls to miCoalesce */ /* Quicky macro to avoid trivial reject procedure calls to RegionCoalesce */
#define Coalesce(newReg, prevBand, curBand) \ #define Coalesce(newReg, prevBand, curBand) \
if (curBand - prevBand == newReg->data->numRects - curBand) { \ if (curBand - prevBand == newReg->data->numRects - curBand) { \
prevBand = miCoalesce(newReg, prevBand, curBand); \ prevBand = RegionCoalesce(newReg, prevBand, curBand); \
} else { \ } else { \
prevBand = curBand; \ prevBand = curBand; \
} }
/*- /*-
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
* miAppendNonO -- * RegionAppendNonO --
* Handle a non-overlapping band for the union and subtract operations. * Handle a non-overlapping band for the union and subtract operations.
* Just adds the (top/bottom-clipped) rectangles into the region. * Just adds the (top/bottom-clipped) rectangles into the region.
* Doesn't have to check for subsumption or anything. * Doesn't have to check for subsumption or anything.
@ -511,7 +511,7 @@ miCoalesce (
*/ */
_X_INLINE static Bool _X_INLINE static Bool
miAppendNonO ( RegionAppendNonO (
RegionPtr pReg, RegionPtr pReg,
BoxPtr r, BoxPtr r,
BoxPtr rEnd, BoxPtr rEnd,
@ -561,9 +561,9 @@ miAppendNonO (
/*- /*-
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
* miRegionOp -- * RegionOp --
* Apply an operation to two regions. Called by miUnion, miInverse, * Apply an operation to two regions. Called by RegionUnion, RegionInverse,
* miSubtract, miIntersect.... Both regions MUST have at least one * RegionSubtract, RegionIntersect.... Both regions MUST have at least one
* rectangle, and cannot be the same object. * rectangle, and cannot be the same object.
* *
* Results: * Results:
@ -599,7 +599,7 @@ typedef Bool (*OverlapProcPtr)(
Bool *pOverlap); Bool *pOverlap);
static Bool static Bool
miRegionOp( RegionOp(
RegionPtr newReg, /* Place to store result */ RegionPtr newReg, /* Place to store result */
RegionPtr reg1, /* First region in operation */ RegionPtr reg1, /* First region in operation */
RegionPtr reg2, /* 2d region in operation */ RegionPtr reg2, /* 2d region in operation */
@ -635,7 +635,7 @@ miRegionOp(
* Break any region computed from a broken region * Break any region computed from a broken region
*/ */
if (REGION_NAR (reg1) || REGION_NAR(reg2)) if (REGION_NAR (reg1) || REGION_NAR(reg2))
return miRegionBreak (newReg); return RegionBreak (newReg);
/* /*
* Initialization: * Initialization:
@ -659,18 +659,18 @@ miRegionOp(
((newReg == reg2) && (numRects > 1))) ((newReg == reg2) && (numRects > 1)))
{ {
oldData = newReg->data; oldData = newReg->data;
newReg->data = &miEmptyData; newReg->data = &RegionEmptyData;
} }
/* guess at new size */ /* guess at new size */
if (numRects > newSize) if (numRects > newSize)
newSize = numRects; newSize = numRects;
newSize <<= 1; newSize <<= 1;
if (!newReg->data) if (!newReg->data)
newReg->data = &miEmptyData; newReg->data = &RegionEmptyData;
else if (newReg->data->size) else if (newReg->data->size)
newReg->data->numRects = 0; newReg->data->numRects = 0;
if (newSize > newReg->data->size) if (newSize > newReg->data->size)
if (!miRectAlloc(newReg, newSize)) if (!RegionRectAlloc(newReg, newSize))
return FALSE; return FALSE;
/* /*
@ -691,7 +691,7 @@ miRegionOp(
/* /*
* prevBand serves to mark the start of the previous band so rectangles * prevBand serves to mark the start of the previous band so rectangles
* can be coalesced into larger rectangles. qv. miCoalesce, above. * can be coalesced into larger rectangles. qv. RegionCoalesce, above.
* In the beginning, there is no previous band, so prevBand == curBand * In the beginning, there is no previous band, so prevBand == curBand
* (curBand is set later on, of course, but the first band will always * (curBand is set later on, of course, but the first band will always
* start at index 0). prevBand and curBand must be indices because of * start at index 0). prevBand and curBand must be indices because of
@ -728,7 +728,7 @@ miRegionOp(
bot = min(r1->y2, r2y1); bot = min(r1->y2, r2y1);
if (top != bot) { if (top != bot) {
curBand = newReg->data->numRects; curBand = newReg->data->numRects;
miAppendNonO(newReg, r1, r1BandEnd, top, bot); RegionAppendNonO(newReg, r1, r1BandEnd, top, bot);
Coalesce(newReg, prevBand, curBand); Coalesce(newReg, prevBand, curBand);
} }
} }
@ -739,7 +739,7 @@ miRegionOp(
bot = min(r2->y2, r1y1); bot = min(r2->y2, r1y1);
if (top != bot) { if (top != bot) {
curBand = newReg->data->numRects; curBand = newReg->data->numRects;
miAppendNonO(newReg, r2, r2BandEnd, top, bot); RegionAppendNonO(newReg, r2, r2BandEnd, top, bot);
Coalesce(newReg, prevBand, curBand); Coalesce(newReg, prevBand, curBand);
} }
} }
@ -781,7 +781,7 @@ miRegionOp(
/* Do first nonOverlap1Func call, which may be able to coalesce */ /* Do first nonOverlap1Func call, which may be able to coalesce */
FindBand(r1, r1BandEnd, r1End, r1y1); FindBand(r1, r1BandEnd, r1End, r1y1);
curBand = newReg->data->numRects; curBand = newReg->data->numRects;
miAppendNonO(newReg, r1, r1BandEnd, max(r1y1, ybot), r1->y2); RegionAppendNonO(newReg, r1, r1BandEnd, max(r1y1, ybot), r1->y2);
Coalesce(newReg, prevBand, curBand); Coalesce(newReg, prevBand, curBand);
/* Just append the rest of the boxes */ /* Just append the rest of the boxes */
AppendRegions(newReg, r1BandEnd, r1End); AppendRegions(newReg, r1BandEnd, r1End);
@ -790,7 +790,7 @@ miRegionOp(
/* Do first nonOverlap2Func call, which may be able to coalesce */ /* Do first nonOverlap2Func call, which may be able to coalesce */
FindBand(r2, r2BandEnd, r2End, r2y1); FindBand(r2, r2BandEnd, r2End, r2y1);
curBand = newReg->data->numRects; curBand = newReg->data->numRects;
miAppendNonO(newReg, r2, r2BandEnd, max(r2y1, ybot), r2->y2); RegionAppendNonO(newReg, r2, r2BandEnd, max(r2y1, ybot), r2->y2);
Coalesce(newReg, prevBand, curBand); Coalesce(newReg, prevBand, curBand);
/* Append rest of boxes */ /* Append rest of boxes */
AppendRegions(newReg, r2BandEnd, r2End); AppendRegions(newReg, r2BandEnd, r2End);
@ -802,7 +802,7 @@ miRegionOp(
if (!(numRects = newReg->data->numRects)) if (!(numRects = newReg->data->numRects))
{ {
xfreeData(newReg); xfreeData(newReg);
newReg->data = &miEmptyData; newReg->data = &RegionEmptyData;
} }
else if (numRects == 1) else if (numRects == 1)
{ {
@ -820,10 +820,10 @@ miRegionOp(
/*- /*-
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
* miSetExtents -- * RegionSetExtents --
* Reset the extents of a region to what they should be. Called by * Reset the extents of a region to what they should be. Called by
* miSubtract and miIntersect as they can't figure it out along the * RegionSubtract and RegionIntersect as they can't figure it out along the
* way or do so easily, as miUnion can. * way or do so easily, as RegionUnion can.
* *
* Results: * Results:
* None. * None.
@ -834,7 +834,7 @@ miRegionOp(
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
*/ */
static void static void
miSetExtents (RegionPtr pReg) RegionSetExtents (RegionPtr pReg)
{ {
BoxPtr pBox, pBoxEnd; BoxPtr pBox, pBoxEnd;
@ -879,8 +879,8 @@ miSetExtents (RegionPtr pReg)
*====================================================================*/ *====================================================================*/
/*- /*-
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
* miIntersectO -- * RegionIntersectO --
* Handle an overlapping band for miIntersect. * Handle an overlapping band for RegionIntersect.
* *
* Results: * Results:
* TRUE if successful. * TRUE if successful.
@ -892,7 +892,7 @@ miSetExtents (RegionPtr pReg)
*/ */
/*ARGSUSED*/ /*ARGSUSED*/
Bool Bool
miIntersect( RegionIntersect(
RegionPtr newReg, /* destination Region */ RegionPtr newReg, /* destination Region */
RegionPtr reg1, RegionPtr reg1,
RegionPtr reg2 /* source regions */ RegionPtr reg2 /* source regions */
@ -922,7 +922,7 @@ miIntersect(
/*- /*-
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
* miUnionO -- * RegionUnionO --
* Handle an overlapping band for the union operation. Picks the * Handle an overlapping band for the union operation. Picks the
* left-most rectangle each time and merges it into the region. * left-most rectangle each time and merges it into the region.
* *
@ -936,7 +936,7 @@ miIntersect(
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
*/ */
static Bool static Bool
miUnionO ( RegionUnionO (
RegionPtr pReg, RegionPtr pReg,
BoxPtr r1, BoxPtr r1,
BoxPtr r1End, BoxPtr r1End,
@ -996,7 +996,7 @@ miUnionO (
} }
Bool Bool
miUnion( RegionUnion(
RegionPtr newReg, /* destination Region */ RegionPtr newReg, /* destination Region */
RegionPtr reg1, RegionPtr reg1,
RegionPtr reg2 /* source regions */ RegionPtr reg2 /* source regions */
@ -1011,13 +1011,13 @@ miUnion(
/*- /*-
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
* miRegionAppend -- * RegionAppend --
* *
* "Append" the rgn rectangles onto the end of dstrgn, maintaining * "Append" the rgn rectangles onto the end of dstrgn, maintaining
* knowledge of YX-banding when it's easy. Otherwise, dstrgn just * knowledge of YX-banding when it's easy. Otherwise, dstrgn just
* becomes a non-y-x-banded random collection of rectangles, and not * becomes a non-y-x-banded random collection of rectangles, and not
* yet a true region. After a sequence of appends, the caller must * yet a true region. After a sequence of appends, the caller must
* call miRegionValidate to ensure that a valid region is constructed. * call RegionValidate to ensure that a valid region is constructed.
* *
* Results: * Results:
* TRUE if successful. * TRUE if successful.
@ -1027,16 +1027,16 @@ miUnion(
* *
*/ */
Bool Bool
miRegionAppend(RegionPtr dstrgn, RegionPtr rgn) RegionAppend(RegionPtr dstrgn, RegionPtr rgn)
{ {
int numRects, dnumRects, size; int numRects, dnumRects, size;
BoxPtr new, old; BoxPtr new, old;
Bool prepend; Bool prepend;
if (REGION_NAR(rgn)) if (REGION_NAR(rgn))
return miRegionBreak (dstrgn); return RegionBreak (dstrgn);
if (!rgn->data && (dstrgn->data == &miEmptyData)) if (!rgn->data && (dstrgn->data == &RegionEmptyData))
{ {
dstrgn->extents = rgn->extents; dstrgn->extents = rgn->extents;
dstrgn->data = NULL; dstrgn->data = NULL;
@ -1180,7 +1180,7 @@ QuickSortRects(
/*- /*-
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
* miRegionValidate -- * RegionValidate --
* *
* Take a ``region'' which is a non-y-x-banded random collection of * Take a ``region'' which is a non-y-x-banded random collection of
* rectangles, and compute a nice region which is the union of all the * rectangles, and compute a nice region which is the union of all the
@ -1204,14 +1204,14 @@ QuickSortRects(
* or a coalescing into 1 box (ala Menus). * or a coalescing into 1 box (ala Menus).
* *
* Step 3. Merge the separate regions down to a single region by calling * Step 3. Merge the separate regions down to a single region by calling
* miUnion. Maximize the work each miUnion call does by using * RegionUnion. Maximize the work each RegionUnion call does by using
* a binary merge. * a binary merge.
* *
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
*/ */
Bool Bool
miRegionValidate(RegionPtr badreg, Bool *pOverlap) RegionValidate(RegionPtr badreg, Bool *pOverlap)
{ {
/* Descriptor for regions under construction in Step 2. */ /* Descriptor for regions under construction in Step 2. */
typedef struct { typedef struct {
@ -1271,7 +1271,7 @@ miRegionValidate(RegionPtr badreg, Bool *pOverlap)
/* Note that step 2 code will never overflow the ri[0].reg rects array */ /* Note that step 2 code will never overflow the ri[0].reg rects array */
ri = (RegionInfo *) malloc(4 * sizeof(RegionInfo)); ri = (RegionInfo *) malloc(4 * sizeof(RegionInfo));
if (!ri) if (!ri)
return miRegionBreak (badreg); return RegionBreak (badreg);
sizeRI = 4; sizeRI = 4;
numRI = 1; numRI = 1;
ri[0].prevBand = 0; ri[0].prevBand = 0;
@ -1344,7 +1344,7 @@ miRegionValidate(RegionPtr badreg, Bool *pOverlap)
rit->curBand = 0; rit->curBand = 0;
rit->reg.extents = *box; rit->reg.extents = *box;
rit->reg.data = NULL; rit->reg.data = NULL;
if (!miRectAlloc(&rit->reg, (i+numRI) / numRI)) /* MUST force allocation */ if (!RegionRectAlloc(&rit->reg, (i+numRI) / numRI)) /* MUST force allocation */
goto bail; goto bail;
NextRect: ; NextRect: ;
} /* for i */ } /* for i */
@ -1374,7 +1374,7 @@ NextRect: ;
{ {
reg = &ri[j].reg; reg = &ri[j].reg;
hreg = &ri[j+half].reg; hreg = &ri[j+half].reg;
if (!miRegionOp(reg, reg, hreg, miUnionO, TRUE, TRUE, pOverlap)) if (!RegionOp(reg, reg, hreg, RegionUnionO, TRUE, TRUE, pOverlap))
ret = FALSE; ret = FALSE;
if (hreg->extents.x1 < reg->extents.x1) if (hreg->extents.x1 < reg->extents.x1)
reg->extents.x1 = hreg->extents.x1; reg->extents.x1 = hreg->extents.x1;
@ -1396,11 +1396,11 @@ bail:
for (i = 0; i < numRI; i++) for (i = 0; i < numRI; i++)
xfreeData(&ri[i].reg); xfreeData(&ri[i].reg);
free(ri); free(ri);
return miRegionBreak (badreg); return RegionBreak (badreg);
} }
RegionPtr RegionPtr
miRectsToRegion(int nrects, xRectangle *prect, int ctype) RegionFromRects(int nrects, xRectangle *prect, int ctype)
{ {
RegionPtr pRgn; RegionPtr pRgn;
@ -1409,7 +1409,7 @@ miRectsToRegion(int nrects, xRectangle *prect, int ctype)
int i; int i;
int x1, y1, x2, y2; int x1, y1, x2, y2;
pRgn = miRegionCreate(NullBox, 0); pRgn = RegionCreate(NullBox, 0);
if (REGION_NAR (pRgn)) if (REGION_NAR (pRgn))
return pRgn; return pRgn;
if (!nrects) if (!nrects)
@ -1435,7 +1435,7 @@ miRectsToRegion(int nrects, xRectangle *prect, int ctype)
pData = xallocData(nrects); pData = xallocData(nrects);
if (!pData) if (!pData)
{ {
miRegionBreak (pRgn); RegionBreak (pRgn);
return pRgn; return pRgn;
} }
pBox = (BoxPtr) (pData + 1); pBox = (BoxPtr) (pData + 1);
@ -1465,10 +1465,10 @@ miRectsToRegion(int nrects, xRectangle *prect, int ctype)
{ {
Bool overlap; /* result ignored */ Bool overlap; /* result ignored */
pRgn->extents.x1 = pRgn->extents.x2 = 0; pRgn->extents.x1 = pRgn->extents.x2 = 0;
miRegionValidate(pRgn, &overlap); RegionValidate(pRgn, &overlap);
} }
else else
miSetExtents(pRgn); RegionSetExtents(pRgn);
good(pRgn); good(pRgn);
} }
else else
@ -1485,7 +1485,7 @@ miRectsToRegion(int nrects, xRectangle *prect, int ctype)
/*- /*-
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
* miSubtractO -- * RegionSubtractO --
* Overlapping band subtraction. x1 is the left-most point not yet * Overlapping band subtraction. x1 is the left-most point not yet
* checked. * checked.
* *
@ -1501,7 +1501,7 @@ miRectsToRegion(int nrects, xRectangle *prect, int ctype)
/*- /*-
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
* miSubtract -- * RegionSubtract --
* Subtract regS from regM and leave the result in regD. * Subtract regS from regM and leave the result in regD.
* S stands for subtrahend, M for minuend and D for difference. * S stands for subtrahend, M for minuend and D for difference.
* *
@ -1514,7 +1514,7 @@ miRectsToRegion(int nrects, xRectangle *prect, int ctype)
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
*/ */
Bool Bool
miSubtract(RegionPtr regD, RegionPtr regM, RegionPtr regS) RegionSubtract(RegionPtr regD, RegionPtr regM, RegionPtr regS)
{ {
return pixman_region_subtract (regD, regM, regS); return pixman_region_subtract (regD, regM, regS);
} }
@ -1525,7 +1525,7 @@ miSubtract(RegionPtr regD, RegionPtr regM, RegionPtr regS)
/*- /*-
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
* miInverse -- * RegionInverse --
* Take a region and a box and return a region that is everything * Take a region and a box and return a region that is everything
* in the box but not in the region. The careful reader will note * in the box but not in the region. The careful reader will note
* that this is the same as subtracting the region from the box... * that this is the same as subtracting the region from the box...
@ -1539,7 +1539,7 @@ miSubtract(RegionPtr regD, RegionPtr regM, RegionPtr regS)
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
*/ */
Bool Bool
miInverse( RegionInverse(
RegionPtr newReg, /* Destination region */ RegionPtr newReg, /* Destination region */
RegionPtr reg1, /* Region to invert */ RegionPtr reg1, /* Region to invert */
BoxPtr invRect /* Bounding box for inversion */ BoxPtr invRect /* Bounding box for inversion */
@ -1548,7 +1548,7 @@ miInverse(
return pixman_region_inverse (newReg, reg1, invRect); return pixman_region_inverse (newReg, reg1, invRect);
} }
int int
miRectIn(RegionPtr region, BoxPtr prect) RegionContainsRect(RegionPtr region, BoxPtr prect)
{ {
return pixman_region_contains_rectangle (region, prect); return pixman_region_contains_rectangle (region, prect);
} }
@ -1558,19 +1558,19 @@ miRectIn(RegionPtr region, BoxPtr prect)
*/ */
void void
miTranslateRegion(RegionPtr pReg, int x, int y) RegionTranslate(RegionPtr pReg, int x, int y)
{ {
pixman_region_translate (pReg, x, y); pixman_region_translate (pReg, x, y);
} }
void void
miRegionReset(RegionPtr pReg, BoxPtr pBox) RegionReset(RegionPtr pReg, BoxPtr pBox)
{ {
pixman_region_reset (pReg, pBox); pixman_region_reset (pReg, pBox);
} }
Bool Bool
miPointInRegion( RegionContainsPoint(
RegionPtr pReg, RegionPtr pReg,
int x, int x,
int y, int y,
@ -1581,30 +1581,30 @@ miPointInRegion(
} }
Bool Bool
miRegionNotEmpty(RegionPtr pReg) RegionNotEmpty(RegionPtr pReg)
{ {
return pixman_region_not_empty (pReg); return pixman_region_not_empty (pReg);
} }
Bool Bool
miRegionBroken(RegionPtr pReg) RegionBroken(RegionPtr pReg)
{ {
good(pReg); good(pReg);
return (REGION_NAR(pReg)); return (REGION_NAR(pReg));
} }
void void
miRegionEmpty(RegionPtr pReg) RegionEmpty(RegionPtr pReg)
{ {
good(pReg); good(pReg);
xfreeData(pReg); xfreeData(pReg);
pReg->extents.x2 = pReg->extents.x1; pReg->extents.x2 = pReg->extents.x1;
pReg->extents.y2 = pReg->extents.y1; pReg->extents.y2 = pReg->extents.y1;
pReg->data = &miEmptyData; pReg->data = &RegionEmptyData;
} }
BoxPtr BoxPtr
miRegionExtents(RegionPtr pReg) RegionExtents(RegionPtr pReg)
{ {
good(pReg); good(pReg);
return(&pReg->extents); return(&pReg->extents);
@ -1729,7 +1729,7 @@ static void QuickSortSpans(
*/ */
int int
miClipSpans( RegionClipSpans(
RegionPtr prgnDst, RegionPtr prgnDst,
DDXPointPtr ppt, DDXPointPtr ppt,
int *pwidth, int *pwidth,

View File

@ -85,7 +85,7 @@ extern _X_EXPORT void miFreeSpanGroup(
SpanGroup * /*spanGroup*/ SpanGroup * /*spanGroup*/
); );
extern _X_EXPORT int miClipSpans( extern _X_EXPORT int RegionClipSpans(
RegionPtr /*prgnDst*/, RegionPtr /*prgnDst*/,
DDXPointPtr /*ppt*/, DDXPointPtr /*ppt*/,
int * /*pwidth*/, int * /*pwidth*/,

View File

@ -268,7 +268,7 @@ miSpriteReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
if (pCursorInfo->isUp && if (pCursorInfo->isUp &&
pCursorInfo->pScreen == pScreen && pCursorInfo->pScreen == pScreen &&
miRectIn(pRegion, &pCursorInfo->saved) != rgnOUT) RegionContainsRect(pRegion, &pCursorInfo->saved) != rgnOUT)
{ {
SPRITE_DEBUG(("Damage remove\n")); SPRITE_DEBUG(("Damage remove\n"));
miSpriteRemoveCursor (pDev, pScreen); miSpriteRemoveCursor (pDev, pScreen);
@ -523,7 +523,7 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
* Damage will take care of destination check * Damage will take care of destination check
*/ */
if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen &&
miRectIn(prgnSrc, &pCursorInfo->saved) != rgnOUT) RegionContainsRect(prgnSrc, &pCursorInfo->saved) != rgnOUT)
{ {
SPRITE_DEBUG (("CopyWindow remove\n")); SPRITE_DEBUG (("CopyWindow remove\n"));
miSpriteRemoveCursor (pDev, pScreen); miSpriteRemoveCursor (pDev, pScreen);