Stop using legacy region macros

We no longer support such old X servers so start using the current
functions.
This commit is contained in:
Pierre Ossman 2020-05-01 15:30:04 +02:00 committed by Lauri Kasanen
parent a00e40c340
commit f528483975
2 changed files with 134 additions and 134 deletions

View File

@ -388,12 +388,12 @@ static inline void add_changed(ScreenPtr pScreen, RegionPtr reg)
vncHooksScreenPtr vncHooksScreen = vncHooksScreenPrivate(pScreen); vncHooksScreenPtr vncHooksScreen = vncHooksScreenPrivate(pScreen);
if (vncHooksScreen->ignoreHooks) if (vncHooksScreen->ignoreHooks)
return; return;
if (REGION_NIL(reg)) if (RegionNil(reg))
return; return;
vncAddChanged(pScreen->myNum, vncAddChanged(pScreen->myNum,
(const struct UpdateRect*)REGION_EXTENTS(pScreen, reg), (const struct UpdateRect*)RegionExtents(reg),
REGION_NUM_RECTS(reg), RegionNumRects(reg),
(const struct UpdateRect*)REGION_RECTS(reg)); (const struct UpdateRect*)RegionRects(reg));
} }
static inline void add_copied(ScreenPtr pScreen, RegionPtr dst, static inline void add_copied(ScreenPtr pScreen, RegionPtr dst,
@ -402,12 +402,12 @@ static inline void add_copied(ScreenPtr pScreen, RegionPtr dst,
vncHooksScreenPtr vncHooksScreen = vncHooksScreenPrivate(pScreen); vncHooksScreenPtr vncHooksScreen = vncHooksScreenPrivate(pScreen);
if (vncHooksScreen->ignoreHooks) if (vncHooksScreen->ignoreHooks)
return; return;
if (REGION_NIL(dst)) if (RegionNil(dst))
return; return;
vncAddCopied(pScreen->myNum, vncAddCopied(pScreen->myNum,
(const struct UpdateRect*)REGION_EXTENTS(pScreen, dst), (const struct UpdateRect*)RegionExtents(dst),
REGION_NUM_RECTS(dst), RegionNumRects(dst),
(const struct UpdateRect*)REGION_RECTS(dst), dx, dy); (const struct UpdateRect*)RegionRects(dst), dx, dy);
} }
static inline Bool is_visible(DrawablePtr drawable) static inline Bool is_visible(DrawablePtr drawable)
@ -542,15 +542,15 @@ static void vncHooksCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
SCREEN_PROLOGUE(pWin->drawable.pScreen, CopyWindow); SCREEN_PROLOGUE(pWin->drawable.pScreen, CopyWindow);
REGION_NULL(pScreen, &copied); RegionNull(&copied);
REGION_COPY(pScreen, &copied, pOldRegion); RegionCopy(&copied, pOldRegion);
screen_box.x1 = 0; screen_box.x1 = 0;
screen_box.y1 = 0; screen_box.y1 = 0;
screen_box.x2 = pScreen->width; screen_box.x2 = pScreen->width;
screen_box.y2 = pScreen->height; screen_box.y2 = pScreen->height;
REGION_INIT(pScreen, &screen_rgn, &screen_box, 1); RegionInit(&screen_rgn, &screen_box, 1);
dx = pWin->drawable.x - ptOldOrg.x; dx = pWin->drawable.x - ptOldOrg.x;
dy = pWin->drawable.y - ptOldOrg.y; dy = pWin->drawable.y - ptOldOrg.y;
@ -559,17 +559,17 @@ static void vncHooksCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
// We also need to copy with changes to the Window's clipping region. // We also need to copy with changes to the Window's clipping region.
// Finally, make sure we don't get copies to or from regions outside // Finally, make sure we don't get copies to or from regions outside
// the framebuffer. // the framebuffer.
REGION_INTERSECT(pScreen, &copied, &copied, &screen_rgn); RegionIntersect(&copied, &copied, &screen_rgn);
REGION_TRANSLATE(pScreen, &copied, dx, dy); RegionTranslate(&copied, dx, dy);
REGION_INTERSECT(pScreen, &copied, &copied, &screen_rgn); RegionIntersect(&copied, &copied, &screen_rgn);
REGION_INTERSECT(pScreen, &copied, &copied, &pWin->borderClip); RegionIntersect(&copied, &copied, &pWin->borderClip);
(*pScreen->CopyWindow) (pWin, ptOldOrg, pOldRegion); (*pScreen->CopyWindow) (pWin, ptOldOrg, pOldRegion);
add_copied(pScreen, &copied, dx, dy); add_copied(pScreen, &copied, dx, dy);
REGION_UNINIT(pScreen, &copied); RegionUninit(&copied);
REGION_UNINIT(pScreen, &screen_rgn); RegionUninit(&screen_rgn);
SCREEN_EPILOGUE(CopyWindow); SCREEN_EPILOGUE(CopyWindow);
} }
@ -590,8 +590,8 @@ static void vncHooksClearToBackground(WindowPtr pWin, int x, int y, int w,
box.x2 = w ? (box.x1 + w) : (pWin->drawable.x + pWin->drawable.width); box.x2 = w ? (box.x1 + w) : (pWin->drawable.x + pWin->drawable.width);
box.y2 = h ? (box.y1 + h) : (pWin->drawable.y + pWin->drawable.height); box.y2 = h ? (box.y1 + h) : (pWin->drawable.y + pWin->drawable.height);
REGION_INIT(pScreen, &reg, &box, 0); RegionInit(&reg, &box, 0);
REGION_INTERSECT(pScreen, &reg, &reg, &pWin->clipList); RegionIntersect(&reg, &reg, &pWin->clipList);
(*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures); (*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures);
@ -599,7 +599,7 @@ static void vncHooksClearToBackground(WindowPtr pWin, int x, int y, int w,
add_changed(pScreen, &reg); add_changed(pScreen, &reg);
} }
REGION_UNINIT(pScreen, &reg); RegionUninit(&reg);
SCREEN_EPILOGUE(ClearToBackground); SCREEN_EPILOGUE(ClearToBackground);
} }
@ -791,19 +791,19 @@ static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
box.y1 = max(pDst->pDrawable->y + yDst, 0); box.y1 = max(pDst->pDrawable->y + yDst, 0);
box.x2 = box.x1 + width; box.x2 = box.x1 + width;
box.y2 = box.y1 + height; box.y2 = box.y1 + height;
REGION_INIT(pScreen, &changed, &box, 0); RegionInit(&changed, &box, 0);
box.x1 = 0; box.x1 = 0;
box.y1 = 0; box.y1 = 0;
box.x2 = pScreen->width; box.x2 = pScreen->width;
box.y2 = pScreen->height; box.y2 = pScreen->height;
REGION_INIT(pScreen, &fbreg, &box, 0); RegionInit(&fbreg, &box, 0);
REGION_INTERSECT(pScreen, &changed, &changed, &fbreg); RegionIntersect(&changed, &changed, &fbreg);
REGION_UNINIT(pScreen, &fbreg); RegionUninit(&fbreg);
} else { } else {
REGION_NULL(pScreen, &changed); RegionNull(&changed);
} }
@ -812,7 +812,7 @@ static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
add_changed(pScreen, &changed); add_changed(pScreen, &changed);
REGION_UNINIT(pScreen, &changed); RegionUninit(&changed);
RENDER_EPILOGUE(Composite); RENDER_EPILOGUE(Composite);
} }
@ -880,27 +880,27 @@ static void vncHooksGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
RegionRec fbreg; RegionRec fbreg;
changed = GlyphsToRegion(pScreen, nlists, lists, glyphs); changed = GlyphsToRegion(pScreen, nlists, lists, glyphs);
REGION_TRANSLATE(pScreen, changed, RegionTranslate(changed,
pDst->pDrawable->x, pDst->pDrawable->y); pDst->pDrawable->x, pDst->pDrawable->y);
fbbox.x1 = 0; fbbox.x1 = 0;
fbbox.y1 = 0; fbbox.y1 = 0;
fbbox.x2 = pScreen->width; fbbox.x2 = pScreen->width;
fbbox.y2 = pScreen->height; fbbox.y2 = pScreen->height;
REGION_INIT(pScreen, &fbreg, &fbbox, 0); RegionInit(&fbreg, &fbbox, 0);
REGION_INTERSECT(pScreen, changed, changed, &fbreg); RegionIntersect(changed, changed, &fbreg);
REGION_UNINIT(pScreen, &fbreg); RegionUninit(&fbreg);
} else { } else {
changed = REGION_CREATE(pScreen, NullBox, 0); changed = RegionCreate(NullBox, 0);
} }
(*ps->Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlists, lists, glyphs); (*ps->Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlists, lists, glyphs);
add_changed(pScreen, changed); add_changed(pScreen, changed);
REGION_DESTROY(pScreen, changed); RegionDestroy(changed);
RENDER_EPILOGUE(Glyphs); RENDER_EPILOGUE(Glyphs);
} }
@ -915,14 +915,14 @@ static void vncHooksCompositeRects(CARD8 op, PicturePtr pDst,
if (is_visible(pDst->pDrawable)) { if (is_visible(pDst->pDrawable)) {
changed = RECTS_TO_REGION(pScreen, nRect, rects, CT_NONE); changed = RECTS_TO_REGION(pScreen, nRect, rects, CT_NONE);
} else { } else {
changed = REGION_CREATE(pScreen, NullBox, 0); changed = RegionCreate(NullBox, 0);
} }
(*ps->CompositeRects)(op, pDst, color, nRect, rects); (*ps->CompositeRects)(op, pDst, color, nRect, rects);
add_changed(pScreen, changed); add_changed(pScreen, changed);
REGION_DESTROY(pScreen, changed); RegionDestroy(changed);
RENDER_EPILOGUE(CompositeRects); RENDER_EPILOGUE(CompositeRects);
} }
@ -970,26 +970,26 @@ static void vncHooksTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
box.y1 += pDst->pDrawable->y; box.y1 += pDst->pDrawable->y;
box.x2 += pDst->pDrawable->x; box.x2 += pDst->pDrawable->x;
box.y2 += pDst->pDrawable->y; box.y2 += pDst->pDrawable->y;
REGION_INIT(pScreen, &changed, &box, 0); RegionInit(&changed, &box, 0);
box.x1 = 0; box.x1 = 0;
box.y1 = 0; box.y1 = 0;
box.x2 = pScreen->width; box.x2 = pScreen->width;
box.y2 = pScreen->height; box.y2 = pScreen->height;
REGION_INIT(pScreen, &fbreg, &box, 0); RegionInit(&fbreg, &box, 0);
REGION_INTERSECT(pScreen, &changed, &changed, &fbreg); RegionIntersect(&changed, &changed, &fbreg);
REGION_UNINIT(pScreen, &fbreg); RegionUninit(&fbreg);
} else { } else {
REGION_NULL(pScreen, &changed); RegionNull(&changed);
} }
(*ps->Trapezoids)(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, traps); (*ps->Trapezoids)(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, traps);
add_changed(pScreen, &changed); add_changed(pScreen, &changed);
REGION_UNINIT(pScreen, &changed); RegionUninit(&changed);
RENDER_EPILOGUE(Trapezoids); RENDER_EPILOGUE(Trapezoids);
} }
@ -1035,26 +1035,26 @@ static void vncHooksTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
box.y1 += pDst->pDrawable->y; box.y1 += pDst->pDrawable->y;
box.x2 += pDst->pDrawable->x; box.x2 += pDst->pDrawable->x;
box.y2 += pDst->pDrawable->y; box.y2 += pDst->pDrawable->y;
REGION_INIT(pScreen, &changed, &box, 0); RegionInit(&changed, &box, 0);
box.x1 = 0; box.x1 = 0;
box.y1 = 0; box.y1 = 0;
box.x2 = pScreen->width; box.x2 = pScreen->width;
box.y2 = pScreen->height; box.y2 = pScreen->height;
REGION_INIT(pScreen, &fbreg, &box, 0); RegionInit(&fbreg, &box, 0);
REGION_INTERSECT(pScreen, &changed, &changed, &fbreg); RegionIntersect(&changed, &changed, &fbreg);
REGION_UNINIT(pScreen, &fbreg); RegionUninit(&fbreg);
} else { } else {
REGION_NULL(pScreen, &changed); RegionNull(&changed);
} }
(*ps->Triangles)(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris); (*ps->Triangles)(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
add_changed(pScreen, &changed); add_changed(pScreen, &changed);
REGION_UNINIT(pScreen, &changed); RegionUninit(&changed);
RENDER_EPILOGUE(Triangles); RENDER_EPILOGUE(Triangles);
} }
@ -1095,26 +1095,26 @@ static void vncHooksTriStrip(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
box.y1 += pDst->pDrawable->y; box.y1 += pDst->pDrawable->y;
box.x2 += pDst->pDrawable->x; box.x2 += pDst->pDrawable->x;
box.y2 += pDst->pDrawable->y; box.y2 += pDst->pDrawable->y;
REGION_INIT(pScreen, &changed, &box, 0); RegionInit(&changed, &box, 0);
box.x1 = 0; box.x1 = 0;
box.y1 = 0; box.y1 = 0;
box.x2 = pScreen->width; box.x2 = pScreen->width;
box.y2 = pScreen->height; box.y2 = pScreen->height;
REGION_INIT(pScreen, &fbreg, &box, 0); RegionInit(&fbreg, &box, 0);
REGION_INTERSECT(pScreen, &changed, &changed, &fbreg); RegionIntersect(&changed, &changed, &fbreg);
REGION_UNINIT(pScreen, &fbreg); RegionUninit(&fbreg);
} else { } else {
REGION_NULL(pScreen, &changed); RegionNull(&changed);
} }
(*ps->TriStrip)(op, pSrc, pDst, maskFormat, xSrc, ySrc, npoint, points); (*ps->TriStrip)(op, pSrc, pDst, maskFormat, xSrc, ySrc, npoint, points);
add_changed(pScreen, &changed); add_changed(pScreen, &changed);
REGION_UNINIT(pScreen, &changed); RegionUninit(&changed);
RENDER_EPILOGUE(TriStrip); RENDER_EPILOGUE(TriStrip);
} }
@ -1153,26 +1153,26 @@ static void vncHooksTriFan(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
box.y1 += pDst->pDrawable->y; box.y1 += pDst->pDrawable->y;
box.x2 += pDst->pDrawable->x; box.x2 += pDst->pDrawable->x;
box.y2 += pDst->pDrawable->y; box.y2 += pDst->pDrawable->y;
REGION_INIT(pScreen, &changed, &box, 0); RegionInit(&changed, &box, 0);
box.x1 = 0; box.x1 = 0;
box.y1 = 0; box.y1 = 0;
box.x2 = pScreen->width; box.x2 = pScreen->width;
box.y2 = pScreen->height; box.y2 = pScreen->height;
REGION_INIT(pScreen, &fbreg, &box, 0); RegionInit(&fbreg, &box, 0);
REGION_INTERSECT(pScreen, &changed, &changed, &fbreg); RegionIntersect(&changed, &changed, &fbreg);
REGION_UNINIT(pScreen, &fbreg); RegionUninit(&fbreg);
} else { } else {
REGION_NULL(pScreen, &changed); RegionNull(&changed);
} }
(*ps->TriFan)(op, pSrc, pDst, maskFormat, xSrc, ySrc, npoint, points); (*ps->TriFan)(op, pSrc, pDst, maskFormat, xSrc, ySrc, npoint, points);
add_changed(pScreen, &changed); add_changed(pScreen, &changed);
REGION_UNINIT(pScreen, &changed); RegionUninit(&changed);
RENDER_EPILOGUE(TriFan); RENDER_EPILOGUE(TriFan);
} }
@ -1361,17 +1361,17 @@ static void vncHooksFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nInit,
GC_OP_PROLOGUE(pGC, FillSpans); GC_OP_PROLOGUE(pGC, FillSpans);
REGION_NULL(pGC->pScreen, &reg); RegionNull(&reg);
REGION_COPY(pGC->pScreen, &reg, pGC->pCompositeClip); RegionCopy(&reg, pGC->pCompositeClip);
if (pDrawable->type == DRAWABLE_WINDOW) if (pDrawable->type == DRAWABLE_WINDOW)
REGION_INTERSECT(pScreen, &reg, &reg, &((WindowPtr)pDrawable)->borderClip); RegionIntersect(&reg, &reg, &((WindowPtr)pDrawable)->borderClip);
(*pGC->ops->FillSpans) (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted); (*pGC->ops->FillSpans) (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted);
add_changed(pGC->pScreen, &reg); add_changed(pGC->pScreen, &reg);
REGION_UNINIT(pGC->pScreen, &reg); RegionUninit(&reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -1387,17 +1387,17 @@ static void vncHooksSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *psrc,
GC_OP_PROLOGUE(pGC, SetSpans); GC_OP_PROLOGUE(pGC, SetSpans);
REGION_NULL(pGC->pScreen, &reg); RegionNull(&reg);
REGION_COPY(pGC->pScreen, &reg, pGC->pCompositeClip); RegionCopy(&reg, pGC->pCompositeClip);
if (pDrawable->type == DRAWABLE_WINDOW) if (pDrawable->type == DRAWABLE_WINDOW)
REGION_INTERSECT(pScreen, &reg, &reg, &((WindowPtr)pDrawable)->borderClip); RegionIntersect(&reg, &reg, &((WindowPtr)pDrawable)->borderClip);
(*pGC->ops->SetSpans) (pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted); (*pGC->ops->SetSpans) (pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
add_changed(pGC->pScreen, &reg); add_changed(pGC->pScreen, &reg);
REGION_UNINIT(pGC->pScreen, &reg); RegionUninit(&reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -1418,15 +1418,15 @@ static void vncHooksPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
box.x2 = box.x1 + w; box.x2 = box.x1 + w;
box.y2 = box.y1 + h; box.y2 = box.y1 + h;
REGION_INIT(pGC->pScreen, &reg, &box, 0); RegionInit(&reg, &box, 0);
REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip); RegionIntersect(&reg, &reg, pGC->pCompositeClip);
(*pGC->ops->PutImage) (pDrawable, pGC, depth, x, y, w, h, leftPad, format, (*pGC->ops->PutImage) (pDrawable, pGC, depth, x, y, w, h, leftPad, format,
pBits); pBits);
add_changed(pGC->pScreen, &reg); add_changed(pGC->pScreen, &reg);
REGION_UNINIT(pGC->pScreen, &reg); RegionUninit(&reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
@ -1447,7 +1447,7 @@ static RegionPtr vncHooksCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
// Apparently this happens now and then... // Apparently this happens now and then...
if ((w == 0) || (h == 0)) if ((w == 0) || (h == 0))
REGION_NULL(pGC->pScreen, &dst); RegionNull(&dst);
else { else {
BoxRec box; BoxRec box;
@ -1456,10 +1456,10 @@ static RegionPtr vncHooksCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
box.x2 = box.x1 + w; box.x2 = box.x1 + w;
box.y2 = box.y1 + h; box.y2 = box.y1 + h;
REGION_INIT(pGC->pScreen, &dst, &box, 0); RegionInit(&dst, &box, 0);
} }
REGION_INTERSECT(pGC->pScreen, &dst, &dst, pGC->pCompositeClip); RegionIntersect(&dst, &dst, pGC->pCompositeClip);
// The source of the data has to be something that's on screen. // The source of the data has to be something that's on screen.
if (is_visible(pSrc)) { if (is_visible(pSrc)) {
@ -1470,24 +1470,24 @@ static RegionPtr vncHooksCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
box.x2 = box.x1 + w; box.x2 = box.x1 + w;
box.y2 = box.y1 + h; box.y2 = box.y1 + h;
REGION_INIT(pGC->pScreen, &src, &box, 0); RegionInit(&src, &box, 0);
if ((pSrc->type == DRAWABLE_WINDOW) && if ((pSrc->type == DRAWABLE_WINDOW) &&
REGION_NOTEMPTY(pScreen, &((WindowPtr)pSrc)->clipList)) { RegionNotEmpty(&((WindowPtr)pSrc)->clipList)) {
REGION_INTERSECT(pScreen, &src, &src, &((WindowPtr)pSrc)->clipList); RegionIntersect(&src, &src, &((WindowPtr)pSrc)->clipList);
} }
REGION_TRANSLATE(pScreen, &src, RegionTranslate(&src,
dstx + pDst->x - srcx - pSrc->x, dstx + pDst->x - srcx - pSrc->x,
dsty + pDst->y - srcy - pSrc->y); dsty + pDst->y - srcy - pSrc->y);
} else { } else {
REGION_NULL(pGC->pScreen, &src); RegionNull(&src);
} }
REGION_NULL(pGC->pScreen, &changed); RegionNull(&changed);
REGION_SUBTRACT(pScreen, &changed, &dst, &src); RegionSubtract(&changed, &dst, &src);
REGION_INTERSECT(pScreen, &dst, &dst, &src); RegionIntersect(&dst, &dst, &src);
ret = (*pGC->ops->CopyArea) (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty); ret = (*pGC->ops->CopyArea) (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty);
@ -1497,9 +1497,9 @@ static RegionPtr vncHooksCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
add_changed(pGC->pScreen, &changed); add_changed(pGC->pScreen, &changed);
REGION_UNINIT(pGC->pScreen, &dst); RegionUninit(&dst);
REGION_UNINIT(pGC->pScreen, &src); RegionUninit(&src);
REGION_UNINIT(pGC->pScreen, &changed); RegionUninit(&changed);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -1526,15 +1526,15 @@ static RegionPtr vncHooksCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
box.x2 = box.x1 + w; box.x2 = box.x1 + w;
box.y2 = box.y1 + h; box.y2 = box.y1 + h;
REGION_INIT(pGC->pScreen, &reg, &box, 0); RegionInit(&reg, &box, 0);
REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip); RegionIntersect(&reg, &reg, pGC->pCompositeClip);
ret = (*pGC->ops->CopyPlane) (pSrc, pDst, pGC, srcx, srcy, w, h, ret = (*pGC->ops->CopyPlane) (pSrc, pDst, pGC, srcx, srcy, w, h,
dstx, dsty, plane); dstx, dsty, plane);
add_changed(pGC->pScreen, &reg); add_changed(pGC->pScreen, &reg);
REGION_UNINIT(pGC->pScreen, &reg); RegionUninit(&reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -1590,14 +1590,14 @@ static void vncHooksPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
box.x2 = maxX + 1 + pDrawable->x; box.x2 = maxX + 1 + pDrawable->x;
box.y2 = maxY + 1 + pDrawable->y; box.y2 = maxY + 1 + pDrawable->y;
REGION_INIT(pGC->pScreen, &reg, &box, 0); RegionInit(&reg, &box, 0);
REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip); RegionIntersect(&reg, &reg, pGC->pCompositeClip);
(*pGC->ops->PolyPoint) (pDrawable, pGC, mode, npt, pts); (*pGC->ops->PolyPoint) (pDrawable, pGC, mode, npt, pts);
add_changed(pGC->pScreen, &reg); add_changed(pGC->pScreen, &reg);
REGION_UNINIT(pGC->pScreen, &reg); RegionUninit(&reg);
out: out:
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -1717,13 +1717,13 @@ static void vncHooksPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode,
} }
reg = RECTS_TO_REGION(pGC->pScreen, nRegRects, regRects, CT_NONE); reg = RECTS_TO_REGION(pGC->pScreen, nRegRects, regRects, CT_NONE);
REGION_INTERSECT(pGC->pScreen, reg, reg, pGC->pCompositeClip); RegionIntersect(reg, reg, pGC->pCompositeClip);
(*pGC->ops->Polylines) (pDrawable, pGC, mode, npt, ppts); (*pGC->ops->Polylines) (pDrawable, pGC, mode, npt, ppts);
add_changed(pGC->pScreen, reg); add_changed(pGC->pScreen, reg);
REGION_DESTROY(pGC->pScreen, reg); RegionDestroy(reg);
out: out:
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -1802,13 +1802,13 @@ static void vncHooksPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg,
} }
reg = RECTS_TO_REGION(pGC->pScreen, nRegRects, regRects, CT_NONE); reg = RECTS_TO_REGION(pGC->pScreen, nRegRects, regRects, CT_NONE);
REGION_INTERSECT(pGC->pScreen, reg, reg, pGC->pCompositeClip); RegionIntersect(reg, reg, pGC->pCompositeClip);
(*pGC->ops->PolySegment) (pDrawable, pGC, nseg, segs); (*pGC->ops->PolySegment) (pDrawable, pGC, nseg, segs);
add_changed(pGC->pScreen, reg); add_changed(pGC->pScreen, reg);
REGION_DESTROY(pGC->pScreen, reg); RegionDestroy(reg);
out: out:
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -1891,13 +1891,13 @@ static void vncHooksPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
} }
reg = RECTS_TO_REGION(pGC->pScreen, nRegRects, regRects, CT_NONE); reg = RECTS_TO_REGION(pGC->pScreen, nRegRects, regRects, CT_NONE);
REGION_INTERSECT(pGC->pScreen, reg, reg, pGC->pCompositeClip); RegionIntersect(reg, reg, pGC->pCompositeClip);
(*pGC->ops->PolyRectangle) (pDrawable, pGC, nrects, rects); (*pGC->ops->PolyRectangle) (pDrawable, pGC, nrects, rects);
add_changed(pGC->pScreen, reg); add_changed(pGC->pScreen, reg);
REGION_DESTROY(pGC->pScreen, reg); RegionDestroy(reg);
out: out:
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -1966,13 +1966,13 @@ static void vncHooksPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs,
} }
reg = RECTS_TO_REGION(pGC->pScreen, nRegRects, regRects, CT_NONE); reg = RECTS_TO_REGION(pGC->pScreen, nRegRects, regRects, CT_NONE);
REGION_INTERSECT(pGC->pScreen, reg, reg, pGC->pCompositeClip); RegionIntersect(reg, reg, pGC->pCompositeClip);
(*pGC->ops->PolyArc) (pDrawable, pGC, narcs, arcs); (*pGC->ops->PolyArc) (pDrawable, pGC, narcs, arcs);
add_changed(pGC->pScreen, reg); add_changed(pGC->pScreen, reg);
REGION_DESTROY(pGC->pScreen, reg); RegionDestroy(reg);
out: out:
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -2029,14 +2029,14 @@ static void vncHooksFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape,
box.x2 = maxX + 1 + pDrawable->x; box.x2 = maxX + 1 + pDrawable->x;
box.y2 = maxY + 1 + pDrawable->y; box.y2 = maxY + 1 + pDrawable->y;
REGION_INIT(pGC->pScreen, &reg, &box, 0); RegionInit(&reg, &box, 0);
REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip); RegionIntersect(&reg, &reg, pGC->pCompositeClip);
(*pGC->ops->FillPolygon) (pDrawable, pGC, shape, mode, count, pts); (*pGC->ops->FillPolygon) (pDrawable, pGC, shape, mode, count, pts);
add_changed(pGC->pScreen, &reg); add_changed(pGC->pScreen, &reg);
REGION_UNINIT(pGC->pScreen, &reg); RegionUninit(&reg);
out: out:
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -2095,13 +2095,13 @@ static void vncHooksPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrects,
} }
reg = RECTS_TO_REGION(pGC->pScreen, nRegRects, regRects, CT_NONE); reg = RECTS_TO_REGION(pGC->pScreen, nRegRects, regRects, CT_NONE);
REGION_INTERSECT(pGC->pScreen, reg, reg, pGC->pCompositeClip); RegionIntersect(reg, reg, pGC->pCompositeClip);
(*pGC->ops->PolyFillRect) (pDrawable, pGC, nrects, rects); (*pGC->ops->PolyFillRect) (pDrawable, pGC, nrects, rects);
add_changed(pGC->pScreen, reg); add_changed(pGC->pScreen, reg);
REGION_DESTROY(pGC->pScreen, reg); RegionDestroy(reg);
out: out:
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -2170,13 +2170,13 @@ static void vncHooksPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs,
} }
reg = RECTS_TO_REGION(pGC->pScreen, nRegRects, regRects, CT_NONE); reg = RECTS_TO_REGION(pGC->pScreen, nRegRects, regRects, CT_NONE);
REGION_INTERSECT(pGC->pScreen, reg, reg, pGC->pCompositeClip); RegionIntersect(reg, reg, pGC->pCompositeClip);
(*pGC->ops->PolyFillArc) (pDrawable, pGC, narcs, arcs); (*pGC->ops->PolyFillArc) (pDrawable, pGC, narcs, arcs);
add_changed(pGC->pScreen, reg); add_changed(pGC->pScreen, reg);
REGION_DESTROY(pGC->pScreen, reg); RegionDestroy(reg);
out: out:
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -2221,14 +2221,14 @@ static int vncHooksPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
GetTextBoundingRect(pDrawable, pGC->font, x, y, count, &box); GetTextBoundingRect(pDrawable, pGC->font, x, y, count, &box);
REGION_INIT(pGC->pScreen, &reg, &box, 0); RegionInit(&reg, &box, 0);
REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip); RegionIntersect(&reg, &reg, pGC->pCompositeClip);
ret = (*pGC->ops->PolyText8) (pDrawable, pGC, x, y, count, chars); ret = (*pGC->ops->PolyText8) (pDrawable, pGC, x, y, count, chars);
add_changed(pGC->pScreen, &reg); add_changed(pGC->pScreen, &reg);
REGION_UNINIT(pGC->pScreen, &reg); RegionUninit(&reg);
out: out:
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -2255,14 +2255,14 @@ static int vncHooksPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
GetTextBoundingRect(pDrawable, pGC->font, x, y, count, &box); GetTextBoundingRect(pDrawable, pGC->font, x, y, count, &box);
REGION_INIT(pGC->pScreen, &reg, &box, 0); RegionInit(&reg, &box, 0);
REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip); RegionIntersect(&reg, &reg, pGC->pCompositeClip);
ret = (*pGC->ops->PolyText16) (pDrawable, pGC, x, y, count, chars); ret = (*pGC->ops->PolyText16) (pDrawable, pGC, x, y, count, chars);
add_changed(pGC->pScreen, &reg); add_changed(pGC->pScreen, &reg);
REGION_UNINIT(pGC->pScreen, &reg); RegionUninit(&reg);
out: out:
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -2288,14 +2288,14 @@ static void vncHooksImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
GetTextBoundingRect(pDrawable, pGC->font, x, y, count, &box); GetTextBoundingRect(pDrawable, pGC->font, x, y, count, &box);
REGION_INIT(pGC->pScreen, &reg, &box, 0); RegionInit(&reg, &box, 0);
REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip); RegionIntersect(&reg, &reg, pGC->pCompositeClip);
(*pGC->ops->ImageText8) (pDrawable, pGC, x, y, count, chars); (*pGC->ops->ImageText8) (pDrawable, pGC, x, y, count, chars);
add_changed(pGC->pScreen, &reg); add_changed(pGC->pScreen, &reg);
REGION_UNINIT(pGC->pScreen, &reg); RegionUninit(&reg);
out: out:
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -2319,14 +2319,14 @@ static void vncHooksImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
GetTextBoundingRect(pDrawable, pGC->font, x, y, count, &box); GetTextBoundingRect(pDrawable, pGC->font, x, y, count, &box);
REGION_INIT(pGC->pScreen, &reg, &box, 0); RegionInit(&reg, &box, 0);
REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip); RegionIntersect(&reg, &reg, pGC->pCompositeClip);
(*pGC->ops->ImageText16) (pDrawable, pGC, x, y, count, chars); (*pGC->ops->ImageText16) (pDrawable, pGC, x, y, count, chars);
add_changed(pGC->pScreen, &reg); add_changed(pGC->pScreen, &reg);
REGION_UNINIT(pGC->pScreen, &reg); RegionUninit(&reg);
out: out:
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -2351,14 +2351,14 @@ static void vncHooksImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x,
GetTextBoundingRect(pDrawable, pGC->font, x, y, nglyph, &box); GetTextBoundingRect(pDrawable, pGC->font, x, y, nglyph, &box);
REGION_INIT(pGC->pScreen, &reg, &box, 0); RegionInit(&reg, &box, 0);
REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip); RegionIntersect(&reg, &reg, pGC->pCompositeClip);
(*pGC->ops->ImageGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); (*pGC->ops->ImageGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
add_changed(pGC->pScreen, &reg); add_changed(pGC->pScreen, &reg);
REGION_UNINIT(pGC->pScreen, &reg); RegionUninit(&reg);
out: out:
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -2383,14 +2383,14 @@ static void vncHooksPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x,
GetTextBoundingRect(pDrawable, pGC->font, x, y, nglyph, &box); GetTextBoundingRect(pDrawable, pGC->font, x, y, nglyph, &box);
REGION_INIT(pGC->pScreen, &reg, &box, 0); RegionInit(&reg, &box, 0);
REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip); RegionIntersect(&reg, &reg, pGC->pCompositeClip);
(*pGC->ops->PolyGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); (*pGC->ops->PolyGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
add_changed(pGC->pScreen, &reg); add_changed(pGC->pScreen, &reg);
REGION_UNINIT(pGC->pScreen, &reg); RegionUninit(&reg);
out: out:
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
@ -2413,14 +2413,14 @@ static void vncHooksPushPixels(GCPtr pGC, PixmapPtr pBitMap,
box.x2 = box.x1 + w; box.x2 = box.x1 + w;
box.y2 = box.y1 + h; box.y2 = box.y1 + h;
REGION_INIT(pGC->pScreen, &reg, &box, 0); RegionInit(&reg, &box, 0);
REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip); RegionIntersect(&reg, &reg, pGC->pCompositeClip);
(*pGC->ops->PushPixels) (pGC, pBitMap, pDrawable, w, h, x, y); (*pGC->ops->PushPixels) (pGC, pBitMap, pDrawable, w, h, x, y);
add_changed(pGC->pScreen, &reg); add_changed(pGC->pScreen, &reg);
REGION_UNINIT(pGC->pScreen, &reg); RegionUninit(&reg);
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }

View File

@ -1003,8 +1003,8 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable)
{ {
RegionPtr borderVisible; RegionPtr borderVisible;
borderVisible = REGION_CREATE(pScreen, NullBox, 1); borderVisible = RegionCreate(NullBox, 1);
REGION_SUBTRACT(pScreen, borderVisible, RegionSubtract(borderVisible,
&pWin->borderClip, &pWin->winSize); &pWin->borderClip, &pWin->winSize);
pWin->valdata->before.borderVisible = borderVisible; pWin->valdata->before.borderVisible = borderVisible;
} }
@ -1013,7 +1013,7 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable)
} }
/* /*
* Use REGION_BREAK to avoid optimizations in ValidateTree * Use RegionBreak to avoid optimizations in ValidateTree
* that assume the root borderClip can't change well, normally * that assume the root borderClip can't change well, normally
* it doesn't...) * it doesn't...)
*/ */
@ -1023,18 +1023,18 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable)
box.y1 = 0; box.y1 = 0;
box.x2 = pScreen->width; box.x2 = pScreen->width;
box.y2 = pScreen->height; box.y2 = pScreen->height;
REGION_INIT (pScreen, &pWin->winSize, &box, 1); RegionInit(&pWin->winSize, &box, 1);
REGION_INIT (pScreen, &pWin->borderSize, &box, 1); RegionInit(&pWin->borderSize, &box, 1);
if (WasViewable) if (WasViewable)
REGION_RESET(pScreen, &pWin->borderClip, &box); RegionReset(&pWin->borderClip, &box);
pWin->drawable.width = pScreen->width; pWin->drawable.width = pScreen->width;
pWin->drawable.height = pScreen->height; pWin->drawable.height = pScreen->height;
REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); RegionBreak(&pWin->clipList);
} }
else else
{ {
REGION_EMPTY(pScreen, &pWin->borderClip); RegionEmpty(&pWin->borderClip);
REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); RegionBreak(&pWin->clipList);
} }
ResizeChildrenWinSize (pWin, 0, 0, 0, 0); ResizeChildrenWinSize (pWin, 0, 0, 0, 0);