aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/mi/miexpose.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-06-11 14:16:16 +0000
committermarha <marha@users.sourceforge.net>2010-06-11 14:16:16 +0000
commitd1e4f4b8546c7955c66dd023bfd6ef437db9d21d (patch)
tree529985e77bfc95aa95fe5b540e8f42b0ef041206 /xorg-server/mi/miexpose.c
parent13919cf85a6ca41d97238de13344aba59e0f7680 (diff)
parent4c61bf84b11e26e6f22648668c95ea760a379163 (diff)
downloadvcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.tar.gz
vcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.tar.bz2
vcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/mi/miexpose.c')
-rw-r--r--xorg-server/mi/miexpose.c120
1 files changed, 58 insertions, 62 deletions
diff --git a/xorg-server/mi/miexpose.c b/xorg-server/mi/miexpose.c
index 2fc19f6ec..89f45016d 100644
--- a/xorg-server/mi/miexpose.c
+++ b/xorg-server/mi/miexpose.c
@@ -131,7 +131,6 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
GCPtr pGC, int srcx, int srcy, int width, int height,
int dstx, int dsty, unsigned long plane)
{
- ScreenPtr pscr;
RegionPtr prgnSrcClip; /* drawable-relative source clip */
RegionRec rgnSrcRec;
RegionPtr prgnDstClip; /* drawable-relative dest clip */
@@ -148,9 +147,6 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
BoxRec expBox;
Bool extents;
- /* This prevents warning about pscr not being used. */
- pGC->pScreen = pscr = pGC->pScreen;
-
/* avoid work if we can */
if (!pGC->graphicsExposures &&
(pDstDrawable->type == DRAWABLE_PIXMAP) &&
@@ -175,21 +171,21 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
if (pGC->subWindowMode == IncludeInferiors)
{
prgnSrcClip = NotClippedByChildren (pSrcWin);
- if ((RECT_IN_REGION(pscr, prgnSrcClip, &TsrcBox)) == rgnIN)
+ if ((RegionContainsRect(prgnSrcClip, &TsrcBox)) == rgnIN)
{
- REGION_DESTROY(pscr, prgnSrcClip);
+ RegionDestroy(prgnSrcClip);
return NULL;
}
}
else
{
- if ((RECT_IN_REGION(pscr, &pSrcWin->clipList, &TsrcBox)) == rgnIN)
+ if ((RegionContainsRect(&pSrcWin->clipList, &TsrcBox)) == rgnIN)
return NULL;
prgnSrcClip = &rgnSrcRec;
- REGION_NULL(pscr, prgnSrcClip);
- REGION_COPY(pscr, prgnSrcClip, &pSrcWin->clipList);
+ RegionNull(prgnSrcClip);
+ RegionCopy(prgnSrcClip, &pSrcWin->clipList);
}
- REGION_TRANSLATE(pscr, prgnSrcClip,
+ RegionTranslate(prgnSrcClip,
-pSrcDrawable->x, -pSrcDrawable->y);
}
else
@@ -206,7 +202,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
box.x2 = pSrcDrawable->width;
box.y2 = pSrcDrawable->height;
prgnSrcClip = &rgnSrcRec;
- REGION_INIT(pscr, prgnSrcClip, &box, 1);
+ RegionInit(prgnSrcClip, &box, 1);
pSrcWin = NULL;
}
@@ -223,11 +219,11 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
else
{
prgnDstClip = &rgnDstRec;
- REGION_NULL(pscr, prgnDstClip);
- REGION_COPY(pscr, prgnDstClip,
+ RegionNull(prgnDstClip);
+ RegionCopy(prgnDstClip,
&((WindowPtr)pDstDrawable)->clipList);
}
- REGION_TRANSLATE(pscr, prgnDstClip,
+ RegionTranslate(prgnDstClip,
-pDstDrawable->x, -pDstDrawable->y);
}
else
@@ -239,24 +235,24 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
box.x2 = pDstDrawable->width;
box.y2 = pDstDrawable->height;
prgnDstClip = &rgnDstRec;
- REGION_INIT(pscr, prgnDstClip, &box, 1);
+ RegionInit(prgnDstClip, &box, 1);
}
/* drawable-relative source region */
- REGION_INIT(pscr, &rgnExposed, &srcBox, 1);
+ RegionInit(&rgnExposed, &srcBox, 1);
/* now get the hidden parts of the source box*/
- REGION_SUBTRACT(pscr, &rgnExposed, &rgnExposed, prgnSrcClip);
+ RegionSubtract(&rgnExposed, &rgnExposed, prgnSrcClip);
/* move them over the destination */
- REGION_TRANSLATE(pscr, &rgnExposed, dstx-srcx, dsty-srcy);
+ RegionTranslate(&rgnExposed, dstx-srcx, dsty-srcy);
/* intersect with visible areas of dest */
- REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, prgnDstClip);
+ RegionIntersect(&rgnExposed, &rgnExposed, prgnDstClip);
/* intersect with client clip region. */
if (pGC->clientClipType == CT_REGION)
- REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, pGC->clientClip);
+ RegionIntersect(&rgnExposed, &rgnExposed, pGC->clientClip);
/*
* If we have LOTS of rectangles, we decide to take the extents
@@ -266,7 +262,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
* for windows.
*/
extents = pGC->graphicsExposures &&
- (REGION_NUM_RECTS(&rgnExposed) > RECTLIMIT) &&
+ (RegionNumRects(&rgnExposed) > RECTLIMIT) &&
(pDstDrawable->type != DRAWABLE_PIXMAP);
if (pSrcWin)
{
@@ -278,13 +274,13 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
* exposed region will undo all our work!
*/
if (extents && pSrcWin && region &&
- (RECT_IN_REGION(pscr, region, &srcBox) != rgnIN))
+ (RegionContainsRect(region, &srcBox) != rgnIN))
extents = FALSE;
}
if (extents)
{
- expBox = *REGION_EXTENTS(pscr, &rgnExposed);
- REGION_RESET(pscr, &rgnExposed, &expBox);
+ expBox = *RegionExtents(&rgnExposed);
+ RegionReset(&rgnExposed, &expBox);
}
if ((pDstDrawable->type != DRAWABLE_PIXMAP) &&
(((WindowPtr)pDstDrawable)->backgroundState != None))
@@ -292,52 +288,52 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
WindowPtr pWin = (WindowPtr)pDstDrawable;
/* make the exposed area screen-relative */
- REGION_TRANSLATE(pscr, &rgnExposed,
+ RegionTranslate(&rgnExposed,
pDstDrawable->x, pDstDrawable->y);
if (extents)
{
/* miPaintWindow doesn't clip, so we have to */
- REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, &pWin->clipList);
+ RegionIntersect(&rgnExposed, &rgnExposed, &pWin->clipList);
}
miPaintWindow((WindowPtr)pDstDrawable, &rgnExposed, PW_BACKGROUND);
if (extents)
{
- REGION_RESET(pscr, &rgnExposed, &expBox);
+ RegionReset(&rgnExposed, &expBox);
}
else
- REGION_TRANSLATE(pscr, &rgnExposed,
+ RegionTranslate(&rgnExposed,
-pDstDrawable->x, -pDstDrawable->y);
}
if (prgnDstClip == &rgnDstRec)
{
- REGION_UNINIT(pscr, prgnDstClip);
+ RegionUninit(prgnDstClip);
}
else if (prgnDstClip != prgnSrcClip)
{
- REGION_DESTROY(pscr, prgnDstClip);
+ RegionDestroy(prgnDstClip);
}
if (prgnSrcClip == &rgnSrcRec)
{
- REGION_UNINIT(pscr, prgnSrcClip);
+ RegionUninit(prgnSrcClip);
}
else
{
- REGION_DESTROY(pscr, prgnSrcClip);
+ RegionDestroy(prgnSrcClip);
}
if (pGC->graphicsExposures)
{
/* don't look */
- RegionPtr exposed = REGION_CREATE(pscr, NullBox, 0);
+ RegionPtr exposed = RegionCreate(NullBox, 0);
*exposed = rgnExposed;
return exposed;
}
else
{
- REGION_UNINIT(pscr, &rgnExposed);
+ RegionUninit(&rgnExposed);
return NULL;
}
}
@@ -348,7 +344,7 @@ void
miSendGraphicsExpose (ClientPtr client, RegionPtr pRgn, XID drawable,
int major, int minor)
{
- if (pRgn && !REGION_NIL(pRgn))
+ if (pRgn && !RegionNil(pRgn))
{
xEvent *pEvent;
xEvent *pe;
@@ -356,8 +352,8 @@ miSendGraphicsExpose (ClientPtr client, RegionPtr pRgn, XID drawable,
int i;
int numRects;
- numRects = REGION_NUM_RECTS(pRgn);
- pBox = REGION_RECTS(pRgn);
+ numRects = RegionNumRects(pRgn);
+ pBox = RegionRects(pRgn);
if(!(pEvent = malloc(numRects * sizeof(xEvent))))
return;
pe = pEvent;
@@ -401,8 +397,8 @@ miSendExposures( WindowPtr pWin, RegionPtr pRgn, int dx, int dy)
xEvent *pEvent, *pe;
int i;
- pBox = REGION_RECTS(pRgn);
- numRects = REGION_NUM_RECTS(pRgn);
+ pBox = RegionRects(pRgn);
+ numRects = RegionNumRects(pRgn);
if(!(pEvent = calloc(1, numRects * sizeof(xEvent))))
return;
@@ -424,9 +420,9 @@ miSendExposures( WindowPtr pWin, RegionPtr pRgn, int dx, int dy)
XID realWin = 0;
if(!pWin->parent) {
- x = panoramiXdataPtr[scrnum].x;
- y = panoramiXdataPtr[scrnum].y;
- pWin = WindowTable[0];
+ x = screenInfo.screens[scrnum]->x;
+ y = screenInfo.screens[scrnum]->y;
+ pWin = screenInfo.screens[0]->root;
realWin = pWin->drawable.id;
} else if (scrnum) {
PanoramiXRes *win;
@@ -457,8 +453,8 @@ void
miWindowExposures( WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed)
{
RegionPtr exposures = prgn;
- if ((prgn && !REGION_NIL(prgn)) ||
- (exposures && !REGION_NIL(exposures)) || other_exposed)
+ if ((prgn && !RegionNil(prgn)) ||
+ (exposures && !RegionNil(exposures)) || other_exposed)
{
RegionRec expRec;
int clientInterested;
@@ -471,15 +467,15 @@ miWindowExposures( WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed)
{
if (exposures)
{
- REGION_UNION(pWin->drawable.pScreen, other_exposed,
+ RegionUnion(other_exposed,
exposures,
other_exposed);
if (exposures != prgn)
- REGION_DESTROY(pWin->drawable.pScreen, exposures);
+ RegionDestroy(exposures);
}
exposures = other_exposed;
}
- if (clientInterested && exposures && (REGION_NUM_RECTS(exposures) > RECTLIMIT))
+ if (clientInterested && exposures && (RegionNumRects(exposures) > RECTLIMIT))
{
/*
* If we have LOTS of rectangles, we decide to take the extents
@@ -489,34 +485,34 @@ miWindowExposures( WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed)
*/
BoxRec box;
- box = *REGION_EXTENTS( pWin->drawable.pScreen, exposures);
+ box = *RegionExtents(exposures);
if (exposures == prgn) {
exposures = &expRec;
- REGION_INIT( pWin->drawable.pScreen, exposures, &box, 1);
- REGION_RESET( pWin->drawable.pScreen, prgn, &box);
+ RegionInit(exposures, &box, 1);
+ RegionReset(prgn, &box);
} else {
- REGION_RESET( pWin->drawable.pScreen, exposures, &box);
- REGION_UNION( pWin->drawable.pScreen, prgn, prgn, exposures);
+ RegionReset(exposures, &box);
+ RegionUnion(prgn, prgn, exposures);
}
/* miPaintWindow doesn't clip, so we have to */
- REGION_INTERSECT( pWin->drawable.pScreen, prgn, prgn, &pWin->clipList);
+ RegionIntersect(prgn, prgn, &pWin->clipList);
}
- if (prgn && !REGION_NIL(prgn))
+ if (prgn && !RegionNil(prgn))
miPaintWindow(pWin, prgn, PW_BACKGROUND);
- if (clientInterested && exposures && !REGION_NIL(exposures))
+ if (clientInterested && exposures && !RegionNil(exposures))
miSendExposures(pWin, exposures,
pWin->drawable.x, pWin->drawable.y);
if (exposures == &expRec)
{
- REGION_UNINIT( pWin->drawable.pScreen, exposures);
+ RegionUninit(exposures);
}
else if (exposures && exposures != prgn && exposures != other_exposed)
- REGION_DESTROY( pWin->drawable.pScreen, exposures);
+ RegionDestroy(exposures);
if (prgn)
- REGION_EMPTY( pWin->drawable.pScreen, prgn);
+ RegionEmpty(prgn);
}
else if (exposures && exposures != prgn)
- REGION_DESTROY( pWin->drawable.pScreen, exposures);
+ RegionDestroy(exposures);
}
#ifdef ROOTLESS
@@ -647,7 +643,7 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin;
}
- prect = malloc(REGION_NUM_RECTS(prgn) * sizeof(xRectangle));
+ prect = malloc(RegionNumRects(prgn) * sizeof(xRectangle));
if (!prect)
return;
@@ -661,8 +657,8 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
ChangeGC (NullClient, pGC, gcmask, gcval);
ValidateGC (drawable, pGC);
- numRects = REGION_NUM_RECTS(prgn);
- pbox = REGION_RECTS(prgn);
+ numRects = RegionNumRects(prgn);
+ pbox = RegionRects(prgn);
for (i= numRects; --i >= 0; pbox++, prect++)
{
prect->x = pbox->x1 - draw_x_off;