From 4c61bf84b11e26e6f22648668c95ea760a379163 Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 11 Jun 2010 12:14:52 +0000 Subject: xserver git update 11/6/2010 --- xorg-server/Xext/shape.c | 70 +++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 39 deletions(-) (limited to 'xorg-server/Xext/shape.c') diff --git a/xorg-server/Xext/shape.c b/xorg-server/Xext/shape.c index f57a20cbf..d0eac294e 100644 --- a/xorg-server/Xext/shape.c +++ b/xorg-server/Xext/shape.c @@ -150,14 +150,12 @@ RegionOperate ( int xoff, int yoff, CreateDftPtr create) { - ScreenPtr pScreen = pWin->drawable.pScreen; - if (srcRgn && (xoff || yoff)) - REGION_TRANSLATE(pScreen, srcRgn, xoff, yoff); + RegionTranslate(srcRgn, xoff, yoff); if (!pWin->parent) { if (srcRgn) - REGION_DESTROY(pScreen, srcRgn); + RegionDestroy(srcRgn); return Success; } @@ -168,7 +166,7 @@ RegionOperate ( */ if (srcRgn == NULL) { if (*destRgnp != NULL) { - REGION_DESTROY (pScreen, *destRgnp); + RegionDestroy(*destRgnp); *destRgnp = 0; /* go on to remove shape and generate ShapeNotify */ } @@ -187,17 +185,17 @@ RegionOperate ( else switch (op) { case ShapeSet: if (*destRgnp) - REGION_DESTROY(pScreen, *destRgnp); + RegionDestroy(*destRgnp); *destRgnp = srcRgn; srcRgn = 0; break; case ShapeUnion: if (*destRgnp) - REGION_UNION(pScreen, *destRgnp, *destRgnp, srcRgn); + RegionUnion(*destRgnp, *destRgnp, srcRgn); break; case ShapeIntersect: if (*destRgnp) - REGION_INTERSECT(pScreen, *destRgnp, *destRgnp, srcRgn); + RegionIntersect(*destRgnp, *destRgnp, srcRgn); else { *destRgnp = srcRgn; srcRgn = 0; @@ -206,21 +204,21 @@ RegionOperate ( case ShapeSubtract: if (!*destRgnp) *destRgnp = (*create)(pWin); - REGION_SUBTRACT(pScreen, *destRgnp, *destRgnp, srcRgn); + RegionSubtract(*destRgnp, *destRgnp, srcRgn); break; case ShapeInvert: if (!*destRgnp) - *destRgnp = REGION_CREATE(pScreen, (BoxPtr) 0, 0); + *destRgnp = RegionCreate((BoxPtr) 0, 0); else - REGION_SUBTRACT(pScreen, *destRgnp, srcRgn, *destRgnp); + RegionSubtract(*destRgnp, srcRgn, *destRgnp); break; default: client->errorValue = op; return BadValue; } if (srcRgn) - REGION_DESTROY(pScreen, srcRgn); - (*pScreen->SetShape) (pWin); + RegionDestroy(srcRgn); + (*pWin->drawable.pScreen->SetShape) (pWin, kind); SendShapeNotify (pWin, kind); return Success; } @@ -234,7 +232,7 @@ CreateBoundingShape (WindowPtr pWin) extents.y1 = -wBorderWidth (pWin); extents.x2 = pWin->drawable.width + wBorderWidth (pWin); extents.y2 = pWin->drawable.height + wBorderWidth (pWin); - return REGION_CREATE(pWin->drawable.pScreen, &extents, 1); + return RegionCreate(&extents, 1); } RegionPtr @@ -246,7 +244,7 @@ CreateClipShape (WindowPtr pWin) extents.y1 = 0; extents.x2 = pWin->drawable.width; extents.y2 = pWin->drawable.height; - return REGION_CREATE(pWin->drawable.pScreen, &extents, 1); + return RegionCreate(&extents, 1); } static int @@ -281,7 +279,6 @@ static int ProcShapeRectangles (ClientPtr client) { WindowPtr pWin; - ScreenPtr pScreen; REQUEST(xShapeRectanglesReq); xRectangle *prects; int nrects, ctype, rc; @@ -314,7 +311,6 @@ ProcShapeRectangles (ClientPtr client) client->errorValue = stuff->ordering; return BadValue; } - pScreen = pWin->drawable.pScreen; nrects = ((stuff->length << 2) - sizeof(xShapeRectanglesReq)); if (nrects & 4) return BadLength; @@ -323,7 +319,7 @@ ProcShapeRectangles (ClientPtr client) ctype = VerifyRectOrder(nrects, prects, (int)stuff->ordering); if (ctype < 0) return BadMatch; - srcRgn = RECTS_TO_REGION(pScreen, nrects, prects, ctype); + srcRgn = RegionFromRects(nrects, prects, ctype); if (!pWin->optional) MakeWindowOptional (pWin); @@ -367,7 +363,7 @@ ProcPanoramiXShapeRectangles( result = ProcShapeRectangles (client); if (result != Success) break; } - return (result); + return result; } #endif @@ -419,7 +415,7 @@ ProcShapeMask (ClientPtr client) if (pPixmap->drawable.pScreen != pScreen || pPixmap->drawable.depth != 1) return BadMatch; - srcRgn = BITMAP_TO_REGION(pScreen, pPixmap); + srcRgn = BitmapToRegion(pScreen, pPixmap); if (!srcRgn) return BadAlloc; } @@ -476,7 +472,7 @@ ProcPanoramiXShapeMask( result = ProcShapeMask (client); if (result != Success) break; } - return (result); + return result; } #endif @@ -489,7 +485,6 @@ static int ProcShapeCombine (ClientPtr client) { WindowPtr pSrcWin, pDestWin; - ScreenPtr pScreen; REQUEST(xShapeCombineReq); RegionPtr srcRgn; RegionPtr *destRgn; @@ -519,7 +514,6 @@ ProcShapeCombine (ClientPtr client) client->errorValue = stuff->destKind; return BadValue; } - pScreen = pDestWin->drawable.pScreen; rc = dixLookupWindow(&pSrcWin, stuff->src, client, DixGetAttrAccess); if (rc != Success) @@ -541,14 +535,14 @@ ProcShapeCombine (ClientPtr client) client->errorValue = stuff->srcKind; return BadValue; } - if (pSrcWin->drawable.pScreen != pScreen) + if (pSrcWin->drawable.pScreen != pDestWin->drawable.pScreen) { return BadMatch; } if (srcRgn) { - tmp = REGION_CREATE(pScreen, (BoxPtr) 0, 0); - REGION_COPY(pScreen, tmp, srcRgn); + tmp = RegionCreate((BoxPtr) 0, 0); + RegionCopy(tmp, srcRgn); srcRgn = tmp; } else srcRgn = (*createSrc) (pSrcWin); @@ -602,7 +596,7 @@ ProcPanoramiXShapeCombine( result = ProcShapeCombine (client); if (result != Success) break; } - return (result); + return result; } #endif @@ -614,7 +608,6 @@ static int ProcShapeOffset (ClientPtr client) { WindowPtr pWin; - ScreenPtr pScreen; REQUEST(xShapeOffsetReq); RegionPtr srcRgn; int rc; @@ -638,11 +631,10 @@ ProcShapeOffset (ClientPtr client) client->errorValue = stuff->destKind; return BadValue; } - pScreen = pWin->drawable.pScreen; if (srcRgn) { - REGION_TRANSLATE(pScreen, srcRgn, stuff->xOff, stuff->yOff); - (*pScreen->SetShape) (pWin); + RegionTranslate(srcRgn, stuff->xOff, stuff->yOff); + (*pWin->drawable.pScreen->SetShape) (pWin, stuff->destKind); } SendShapeNotify (pWin, (int)stuff->destKind); return Success; @@ -670,7 +662,7 @@ ProcPanoramiXShapeOffset( result = ProcShapeOffset (client); if(result != Success) break; } - return (result); + return result; } #endif @@ -697,7 +689,7 @@ ProcShapeQueryExtents (ClientPtr client) rep.clipShaped = (wClipShape(pWin) != 0); if ((region = wBoundingShape(pWin))) { /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */ - pExtents = REGION_EXTENTS(pWin->drawable.pScreen, region); + pExtents = RegionExtents(region); extents = *pExtents; } else { extents.x1 = -wBorderWidth (pWin); @@ -711,7 +703,7 @@ ProcShapeQueryExtents (ClientPtr client) rep.heightBoundingShape = extents.y2 - extents.y1; if ((region = wClipShape(pWin))) { /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */ - pExtents = REGION_EXTENTS(pWin->drawable.pScreen, region); + pExtents = RegionExtents(region); extents = *pExtents; } else { extents.x1 = 0; @@ -899,7 +891,7 @@ SendShapeNotify (WindowPtr pWin, int which) case ShapeBounding: region = wBoundingShape(pWin); if (region) { - extents = *REGION_EXTENTS(pWin->drawable.pScreen, region); + extents = *RegionExtents(region); shaped = xTrue; } else { extents.x1 = -wBorderWidth (pWin); @@ -912,7 +904,7 @@ SendShapeNotify (WindowPtr pWin, int which) case ShapeClip: region = wClipShape(pWin); if (region) { - extents = *REGION_EXTENTS(pWin->drawable.pScreen, region); + extents = *RegionExtents(region); shaped = xTrue; } else { extents.x1 = 0; @@ -925,7 +917,7 @@ SendShapeNotify (WindowPtr pWin, int which) case ShapeInput: region = wInputShape(pWin); if (region) { - extents = *REGION_EXTENTS(pWin->drawable.pScreen, region); + extents = *RegionExtents(region); shaped = xTrue; } else { extents.x1 = -wBorderWidth (pWin); @@ -1050,8 +1042,8 @@ ProcShapeGetRectangles (ClientPtr client) } } else { BoxPtr box; - nrects = REGION_NUM_RECTS(region); - box = REGION_RECTS(region); + nrects = RegionNumRects(region); + box = RegionRects(region); rects = malloc(nrects * sizeof (xRectangle)); if (!rects && nrects) return BadAlloc; -- cgit v1.2.3