aboutsummaryrefslogtreecommitdiffstats
path: root/unix/xserver
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2020-06-15 09:57:28 +0200
committerPierre Ossman <ossman@cendio.se>2020-06-15 09:57:28 +0200
commitb8a24f055f1a29886d8b18bb3f0902144dc5bd14 (patch)
tree1c4bd2727da6125b4716f4251138e63bd40f6070 /unix/xserver
parentda1ce978b97118b6f2721502702e7724523eddd4 (diff)
parent6e6a221e3db5f384bcadeeef015676ef2b91d48e (diff)
downloadtigervnc-b8a24f055f1a29886d8b18bb3f0902144dc5bd14.tar.gz
tigervnc-b8a24f055f1a29886d8b18bb3f0902144dc5bd14.zip
Merge branch 'regions' of https://github.com/CendioOssman/tigervnc
Diffstat (limited to 'unix/xserver')
-rw-r--r--unix/xserver/hw/vnc/Makefile.am3
-rw-r--r--unix/xserver/hw/vnc/vncExtInit.cc30
-rw-r--r--unix/xserver/hw/vnc/vncExtInit.h8
-rw-r--r--unix/xserver/hw/vnc/vncHooks.c248
-rw-r--r--unix/xserver/hw/vnc/xvnc.c18
5 files changed, 150 insertions, 157 deletions
diff --git a/unix/xserver/hw/vnc/Makefile.am b/unix/xserver/hw/vnc/Makefile.am
index ee18bf99..d2d0265b 100644
--- a/unix/xserver/hw/vnc/Makefile.am
+++ b/unix/xserver/hw/vnc/Makefile.am
@@ -5,9 +5,8 @@ RFB_LIB=$(TIGERVNC_BUILDDIR)/common/rfb/librfb.la
RDR_LIB=$(TIGERVNC_BUILDDIR)/common/rdr/librdr.la
OS_LIB=$(TIGERVNC_BUILDDIR)/common/os/libos.la
NETWORK_LIB=$(TIGERVNC_BUILDDIR)/common/network/libnetwork.la
-XREGION_LIB=$(TIGERVNC_BUILDDIR)/common/Xregion/libXregion.la
UNIXCOMMON_LIB=$(TIGERVNC_BUILDDIR)/unix/common/libunixcommon.la
-COMMON_LIBS=$(NETWORK_LIB) $(RFB_LIB) $(RDR_LIB) $(XREGION_LIB) $(OS_LIB) $(UNIXCOMMON_LIB)
+COMMON_LIBS=$(NETWORK_LIB) $(RFB_LIB) $(RDR_LIB) $(OS_LIB) $(UNIXCOMMON_LIB)
noinst_LTLIBRARIES = libvnccommon.la
diff --git a/unix/xserver/hw/vnc/vncExtInit.cc b/unix/xserver/hw/vnc/vncExtInit.cc
index e2dd4eee..1d08f86e 100644
--- a/unix/xserver/hw/vnc/vncExtInit.cc
+++ b/unix/xserver/hw/vnc/vncExtInit.cc
@@ -150,9 +150,6 @@ void vncExtensionInit(void)
if (vncGetScreenCount() > MAXSCREENS)
vncFatalError("vncExtensionInit: too many screens\n");
- if (sizeof(ShortRect) != sizeof(struct UpdateRect))
- vncFatalError("vncExtensionInit: Incompatible ShortRect size\n");
-
vncAddExtension();
vncSelectionInit();
@@ -372,25 +369,24 @@ void vncSetLEDState(unsigned long leds)
desktop[scr]->setLEDState(state);
}
-void vncAddChanged(int scrIdx, const struct UpdateRect *extents,
- int nRects, const struct UpdateRect *rects)
+void vncAddChanged(int scrIdx, int nRects,
+ const struct UpdateRect *rects)
{
- Region reg;
-
- reg.setExtentsAndOrderedRects((const ShortRect*)extents,
- nRects, (const ShortRect*)rects);
- desktop[scrIdx]->add_changed(reg);
+ for (int i = 0;i < nRects;i++) {
+ desktop[scrIdx]->add_changed(Region(Rect(rects[i].x1, rects[i].y1,
+ rects[i].x2, rects[i].y2)));
+ }
}
-void vncAddCopied(int scrIdx, const struct UpdateRect *extents,
- int nRects, const struct UpdateRect *rects,
+void vncAddCopied(int scrIdx, int nRects,
+ const struct UpdateRect *rects,
int dx, int dy)
{
- Region reg;
-
- reg.setExtentsAndOrderedRects((const ShortRect*)extents,
- nRects, (const ShortRect*)rects);
- desktop[scrIdx]->add_copied(reg, rfb::Point(dx, dy));
+ for (int i = 0;i < nRects;i++) {
+ desktop[scrIdx]->add_copied(Region(Rect(rects[i].x1, rects[i].y1,
+ rects[i].x2, rects[i].y2)),
+ Point(dx, dy));
+ }
}
void vncSetCursor(int width, int height, int hotX, int hotY,
diff --git a/unix/xserver/hw/vnc/vncExtInit.h b/unix/xserver/hw/vnc/vncExtInit.h
index 1fb87c19..23c0c669 100644
--- a/unix/xserver/hw/vnc/vncExtInit.h
+++ b/unix/xserver/hw/vnc/vncExtInit.h
@@ -73,10 +73,10 @@ struct UpdateRect {
short x1, y1, x2, y2;
};
-void vncAddChanged(int scrIdx, const struct UpdateRect *extents,
- int nRects, const struct UpdateRect *rects);
-void vncAddCopied(int scrIdx, const struct UpdateRect *extents,
- int nRects, const struct UpdateRect *rects,
+void vncAddChanged(int scrIdx, int nRects,
+ const struct UpdateRect *rects);
+void vncAddCopied(int scrIdx, int nRects,
+ const struct UpdateRect *rects,
int dx, int dy);
void vncSetCursor(int width, int height, int hotX, int hotY,
diff --git a/unix/xserver/hw/vnc/vncHooks.c b/unix/xserver/hw/vnc/vncHooks.c
index 9c24e897..a8ab917b 100644
--- a/unix/xserver/hw/vnc/vncHooks.c
+++ b/unix/xserver/hw/vnc/vncHooks.c
@@ -337,12 +337,11 @@ static inline void add_changed(ScreenPtr pScreen, RegionPtr reg)
vncHooksScreenPtr vncHooksScreen = vncHooksScreenPrivate(pScreen);
if (vncHooksScreen->ignoreHooks)
return;
- if (REGION_NIL(reg))
+ if (RegionNil(reg))
return;
vncAddChanged(pScreen->myNum,
- (const struct UpdateRect*)REGION_EXTENTS(pScreen, reg),
- REGION_NUM_RECTS(reg),
- (const struct UpdateRect*)REGION_RECTS(reg));
+ RegionNumRects(reg),
+ (const struct UpdateRect*)RegionRects(reg));
}
static inline void add_copied(ScreenPtr pScreen, RegionPtr dst,
@@ -351,12 +350,11 @@ static inline void add_copied(ScreenPtr pScreen, RegionPtr dst,
vncHooksScreenPtr vncHooksScreen = vncHooksScreenPrivate(pScreen);
if (vncHooksScreen->ignoreHooks)
return;
- if (REGION_NIL(dst))
+ if (RegionNil(dst))
return;
vncAddCopied(pScreen->myNum,
- (const struct UpdateRect*)REGION_EXTENTS(pScreen, dst),
- REGION_NUM_RECTS(dst),
- (const struct UpdateRect*)REGION_RECTS(dst), dx, dy);
+ RegionNumRects(dst),
+ (const struct UpdateRect*)RegionRects(dst), dx, dy);
}
static inline Bool is_visible(DrawablePtr drawable)
@@ -478,15 +476,15 @@ static void vncHooksCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
SCREEN_PROLOGUE(pWin->drawable.pScreen, CopyWindow);
- REGION_NULL(pScreen, &copied);
- REGION_COPY(pScreen, &copied, pOldRegion);
+ RegionNull(&copied);
+ RegionCopy(&copied, pOldRegion);
screen_box.x1 = 0;
screen_box.y1 = 0;
screen_box.x2 = pScreen->width;
screen_box.y2 = pScreen->height;
- REGION_INIT(pScreen, &screen_rgn, &screen_box, 1);
+ RegionInitBoxes(&screen_rgn, &screen_box, 1);
dx = pWin->drawable.x - ptOldOrg.x;
dy = pWin->drawable.y - ptOldOrg.y;
@@ -495,17 +493,17 @@ static void vncHooksCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
// 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
// the framebuffer.
- REGION_INTERSECT(pScreen, &copied, &copied, &screen_rgn);
- REGION_TRANSLATE(pScreen, &copied, dx, dy);
- REGION_INTERSECT(pScreen, &copied, &copied, &screen_rgn);
- REGION_INTERSECT(pScreen, &copied, &copied, &pWin->borderClip);
+ RegionIntersect(&copied, &copied, &screen_rgn);
+ RegionTranslate(&copied, dx, dy);
+ RegionIntersect(&copied, &copied, &screen_rgn);
+ RegionIntersect(&copied, &copied, &pWin->borderClip);
(*pScreen->CopyWindow) (pWin, ptOldOrg, pOldRegion);
add_copied(pScreen, &copied, dx, dy);
- REGION_UNINIT(pScreen, &copied);
- REGION_UNINIT(pScreen, &screen_rgn);
+ RegionUninit(&copied);
+ RegionUninit(&screen_rgn);
SCREEN_EPILOGUE(CopyWindow);
}
@@ -526,8 +524,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.y2 = h ? (box.y1 + h) : (pWin->drawable.y + pWin->drawable.height);
- REGION_INIT(pScreen, &reg, &box, 0);
- REGION_INTERSECT(pScreen, &reg, &reg, &pWin->clipList);
+ RegionInitBoxes(&reg, &box, 1);
+ RegionIntersect(&reg, &reg, &pWin->clipList);
(*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures);
@@ -535,7 +533,7 @@ static void vncHooksClearToBackground(WindowPtr pWin, int x, int y, int w,
add_changed(pScreen, &reg);
}
- REGION_UNINIT(pScreen, &reg);
+ RegionUninit(&reg);
SCREEN_EPILOGUE(ClearToBackground);
}
@@ -690,19 +688,19 @@ static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
box.y1 = max(pDst->pDrawable->y + yDst, 0);
box.x2 = box.x1 + width;
box.y2 = box.y1 + height;
- REGION_INIT(pScreen, &changed, &box, 0);
+ RegionInitBoxes(&changed, &box, 1);
box.x1 = 0;
box.y1 = 0;
box.x2 = pScreen->width;
box.y2 = pScreen->height;
- REGION_INIT(pScreen, &fbreg, &box, 0);
+ RegionInitBoxes(&fbreg, &box, 1);
- REGION_INTERSECT(pScreen, &changed, &changed, &fbreg);
+ RegionIntersect(&changed, &changed, &fbreg);
- REGION_UNINIT(pScreen, &fbreg);
+ RegionUninit(&fbreg);
} else {
- REGION_NULL(pScreen, &changed);
+ RegionNull(&changed);
}
@@ -711,7 +709,7 @@ static void vncHooksComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
add_changed(pScreen, &changed);
- REGION_UNINIT(pScreen, &changed);
+ RegionUninit(&changed);
RENDER_EPILOGUE(Composite);
}
@@ -793,27 +791,27 @@ static void vncHooksGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
RegionRec fbreg;
changed = GlyphsToRegion(pScreen, nlists, lists, glyphs);
- REGION_TRANSLATE(pScreen, changed,
+ RegionTranslate(changed,
pDst->pDrawable->x, pDst->pDrawable->y);
fbbox.x1 = 0;
fbbox.y1 = 0;
fbbox.x2 = pScreen->width;
fbbox.y2 = pScreen->height;
- REGION_INIT(pScreen, &fbreg, &fbbox, 0);
+ RegionInitBoxes(&fbreg, &fbbox, 1);
- REGION_INTERSECT(pScreen, changed, changed, &fbreg);
+ RegionIntersect(changed, changed, &fbreg);
- REGION_UNINIT(pScreen, &fbreg);
+ RegionUninit(&fbreg);
} else {
- changed = REGION_CREATE(pScreen, NullBox, 0);
+ changed = RegionCreate(NullBox, 0);
}
(*ps->Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlists, lists, glyphs);
add_changed(pScreen, changed);
- REGION_DESTROY(pScreen, changed);
+ RegionDestroy(changed);
RENDER_EPILOGUE(Glyphs);
}
@@ -828,14 +826,14 @@ static void vncHooksCompositeRects(CARD8 op, PicturePtr pDst,
if (is_visible(pDst->pDrawable)) {
changed = RECTS_TO_REGION(pScreen, nRect, rects, CT_NONE);
} else {
- changed = REGION_CREATE(pScreen, NullBox, 0);
+ changed = RegionCreate(NullBox, 0);
}
(*ps->CompositeRects)(op, pDst, color, nRect, rects);
add_changed(pScreen, changed);
- REGION_DESTROY(pScreen, changed);
+ RegionDestroy(changed);
RENDER_EPILOGUE(CompositeRects);
}
@@ -883,26 +881,26 @@ static void vncHooksTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
box.y1 += pDst->pDrawable->y;
box.x2 += pDst->pDrawable->x;
box.y2 += pDst->pDrawable->y;
- REGION_INIT(pScreen, &changed, &box, 0);
+ RegionInitBoxes(&changed, &box, 1);
box.x1 = 0;
box.y1 = 0;
box.x2 = pScreen->width;
box.y2 = pScreen->height;
- REGION_INIT(pScreen, &fbreg, &box, 0);
+ RegionInitBoxes(&fbreg, &box, 1);
- REGION_INTERSECT(pScreen, &changed, &changed, &fbreg);
+ RegionIntersect(&changed, &changed, &fbreg);
- REGION_UNINIT(pScreen, &fbreg);
+ RegionUninit(&fbreg);
} else {
- REGION_NULL(pScreen, &changed);
+ RegionNull(&changed);
}
(*ps->Trapezoids)(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, traps);
add_changed(pScreen, &changed);
- REGION_UNINIT(pScreen, &changed);
+ RegionUninit(&changed);
RENDER_EPILOGUE(Trapezoids);
}
@@ -948,26 +946,26 @@ static void vncHooksTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
box.y1 += pDst->pDrawable->y;
box.x2 += pDst->pDrawable->x;
box.y2 += pDst->pDrawable->y;
- REGION_INIT(pScreen, &changed, &box, 0);
+ RegionInitBoxes(&changed, &box, 1);
box.x1 = 0;
box.y1 = 0;
box.x2 = pScreen->width;
box.y2 = pScreen->height;
- REGION_INIT(pScreen, &fbreg, &box, 0);
+ RegionInitBoxes(&fbreg, &box, 1);
- REGION_INTERSECT(pScreen, &changed, &changed, &fbreg);
+ RegionIntersect(&changed, &changed, &fbreg);
- REGION_UNINIT(pScreen, &fbreg);
+ RegionUninit(&fbreg);
} else {
- REGION_NULL(pScreen, &changed);
+ RegionNull(&changed);
}
(*ps->Triangles)(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
add_changed(pScreen, &changed);
- REGION_UNINIT(pScreen, &changed);
+ RegionUninit(&changed);
RENDER_EPILOGUE(Triangles);
}
@@ -1006,26 +1004,26 @@ static void vncHooksTriStrip(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
box.y1 += pDst->pDrawable->y;
box.x2 += pDst->pDrawable->x;
box.y2 += pDst->pDrawable->y;
- REGION_INIT(pScreen, &changed, &box, 0);
+ RegionInitBoxes(&changed, &box, 1);
box.x1 = 0;
box.y1 = 0;
box.x2 = pScreen->width;
box.y2 = pScreen->height;
- REGION_INIT(pScreen, &fbreg, &box, 0);
+ RegionInitBoxes(&fbreg, &box, 1);
- REGION_INTERSECT(pScreen, &changed, &changed, &fbreg);
+ RegionIntersect(&changed, &changed, &fbreg);
- REGION_UNINIT(pScreen, &fbreg);
+ RegionUninit(&fbreg);
} else {
- REGION_NULL(pScreen, &changed);
+ RegionNull(&changed);
}
(*ps->TriStrip)(op, pSrc, pDst, maskFormat, xSrc, ySrc, npoint, points);
add_changed(pScreen, &changed);
- REGION_UNINIT(pScreen, &changed);
+ RegionUninit(&changed);
RENDER_EPILOGUE(TriStrip);
}
@@ -1064,26 +1062,26 @@ static void vncHooksTriFan(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
box.y1 += pDst->pDrawable->y;
box.x2 += pDst->pDrawable->x;
box.y2 += pDst->pDrawable->y;
- REGION_INIT(pScreen, &changed, &box, 0);
+ RegionInitBoxes(&changed, &box, 1);
box.x1 = 0;
box.y1 = 0;
box.x2 = pScreen->width;
box.y2 = pScreen->height;
- REGION_INIT(pScreen, &fbreg, &box, 0);
+ RegionInitBoxes(&fbreg, &box, 1);
- REGION_INTERSECT(pScreen, &changed, &changed, &fbreg);
+ RegionIntersect(&changed, &changed, &fbreg);
- REGION_UNINIT(pScreen, &fbreg);
+ RegionUninit(&fbreg);
} else {
- REGION_NULL(pScreen, &changed);
+ RegionNull(&changed);
}
(*ps->TriFan)(op, pSrc, pDst, maskFormat, xSrc, ySrc, npoint, points);
add_changed(pScreen, &changed);
- REGION_UNINIT(pScreen, &changed);
+ RegionUninit(&changed);
RENDER_EPILOGUE(TriFan);
}
@@ -1261,17 +1259,17 @@ static void vncHooksFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nInit,
GC_OP_PROLOGUE(pGC, FillSpans);
- REGION_NULL(pGC->pScreen, &reg);
- REGION_COPY(pGC->pScreen, &reg, pGC->pCompositeClip);
+ RegionNull(&reg);
+ RegionCopy(&reg, pGC->pCompositeClip);
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);
add_changed(pGC->pScreen, &reg);
- REGION_UNINIT(pGC->pScreen, &reg);
+ RegionUninit(&reg);
GC_OP_EPILOGUE(pGC);
}
@@ -1287,17 +1285,17 @@ static void vncHooksSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *psrc,
GC_OP_PROLOGUE(pGC, SetSpans);
- REGION_NULL(pGC->pScreen, &reg);
- REGION_COPY(pGC->pScreen, &reg, pGC->pCompositeClip);
+ RegionNull(&reg);
+ RegionCopy(&reg, pGC->pCompositeClip);
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);
add_changed(pGC->pScreen, &reg);
- REGION_UNINIT(pGC->pScreen, &reg);
+ RegionUninit(&reg);
GC_OP_EPILOGUE(pGC);
}
@@ -1318,15 +1316,15 @@ static void vncHooksPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
- REGION_INIT(pGC->pScreen, &reg, &box, 0);
- REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip);
+ RegionInitBoxes(&reg, &box, 1);
+ RegionIntersect(&reg, &reg, pGC->pCompositeClip);
(*pGC->ops->PutImage) (pDrawable, pGC, depth, x, y, w, h, leftPad, format,
pBits);
add_changed(pGC->pScreen, &reg);
- REGION_UNINIT(pGC->pScreen, &reg);
+ RegionUninit(&reg);
GC_OP_EPILOGUE(pGC);
}
@@ -1347,7 +1345,7 @@ static RegionPtr vncHooksCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
// Apparently this happens now and then...
if ((w == 0) || (h == 0))
- REGION_NULL(pGC->pScreen, &dst);
+ RegionNull(&dst);
else {
BoxRec box;
@@ -1356,10 +1354,10 @@ static RegionPtr vncHooksCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
- REGION_INIT(pGC->pScreen, &dst, &box, 0);
+ RegionInitBoxes(&dst, &box, 1);
}
- 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.
if (is_visible(pSrc)) {
@@ -1370,24 +1368,24 @@ static RegionPtr vncHooksCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
- REGION_INIT(pGC->pScreen, &src, &box, 0);
+ RegionInitBoxes(&src, &box, 1);
if ((pSrc->type == DRAWABLE_WINDOW) &&
- REGION_NOTEMPTY(pScreen, &((WindowPtr)pSrc)->clipList)) {
- REGION_INTERSECT(pScreen, &src, &src, &((WindowPtr)pSrc)->clipList);
+ RegionNotEmpty(&((WindowPtr)pSrc)->clipList)) {
+ RegionIntersect(&src, &src, &((WindowPtr)pSrc)->clipList);
}
- REGION_TRANSLATE(pScreen, &src,
+ RegionTranslate(&src,
dstx + pDst->x - srcx - pSrc->x,
dsty + pDst->y - srcy - pSrc->y);
} else {
- REGION_NULL(pGC->pScreen, &src);
+ RegionNull(&src);
}
- REGION_NULL(pGC->pScreen, &changed);
+ RegionNull(&changed);
- REGION_SUBTRACT(pScreen, &changed, &dst, &src);
- REGION_INTERSECT(pScreen, &dst, &dst, &src);
+ RegionSubtract(&changed, &dst, &src);
+ RegionIntersect(&dst, &dst, &src);
ret = (*pGC->ops->CopyArea) (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty);
@@ -1397,9 +1395,9 @@ static RegionPtr vncHooksCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
add_changed(pGC->pScreen, &changed);
- REGION_UNINIT(pGC->pScreen, &dst);
- REGION_UNINIT(pGC->pScreen, &src);
- REGION_UNINIT(pGC->pScreen, &changed);
+ RegionUninit(&dst);
+ RegionUninit(&src);
+ RegionUninit(&changed);
GC_OP_EPILOGUE(pGC);
@@ -1426,15 +1424,15 @@ static RegionPtr vncHooksCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
- REGION_INIT(pGC->pScreen, &reg, &box, 0);
- REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip);
+ RegionInitBoxes(&reg, &box, 1);
+ RegionIntersect(&reg, &reg, pGC->pCompositeClip);
ret = (*pGC->ops->CopyPlane) (pSrc, pDst, pGC, srcx, srcy, w, h,
dstx, dsty, plane);
add_changed(pGC->pScreen, &reg);
- REGION_UNINIT(pGC->pScreen, &reg);
+ RegionUninit(&reg);
GC_OP_EPILOGUE(pGC);
@@ -1490,14 +1488,14 @@ static void vncHooksPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
box.x2 = maxX + 1 + pDrawable->x;
box.y2 = maxY + 1 + pDrawable->y;
- REGION_INIT(pGC->pScreen, &reg, &box, 0);
- REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip);
+ RegionInitBoxes(&reg, &box, 1);
+ RegionIntersect(&reg, &reg, pGC->pCompositeClip);
(*pGC->ops->PolyPoint) (pDrawable, pGC, mode, npt, pts);
add_changed(pGC->pScreen, &reg);
- REGION_UNINIT(pGC->pScreen, &reg);
+ RegionUninit(&reg);
out:
GC_OP_EPILOGUE(pGC);
@@ -1617,13 +1615,13 @@ static void vncHooksPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode,
}
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);
add_changed(pGC->pScreen, reg);
- REGION_DESTROY(pGC->pScreen, reg);
+ RegionDestroy(reg);
out:
GC_OP_EPILOGUE(pGC);
@@ -1702,13 +1700,13 @@ static void vncHooksPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg,
}
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);
add_changed(pGC->pScreen, reg);
- REGION_DESTROY(pGC->pScreen, reg);
+ RegionDestroy(reg);
out:
GC_OP_EPILOGUE(pGC);
@@ -1791,13 +1789,13 @@ static void vncHooksPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
}
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);
add_changed(pGC->pScreen, reg);
- REGION_DESTROY(pGC->pScreen, reg);
+ RegionDestroy(reg);
out:
GC_OP_EPILOGUE(pGC);
@@ -1866,13 +1864,13 @@ static void vncHooksPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs,
}
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);
add_changed(pGC->pScreen, reg);
- REGION_DESTROY(pGC->pScreen, reg);
+ RegionDestroy(reg);
out:
GC_OP_EPILOGUE(pGC);
@@ -1929,14 +1927,14 @@ static void vncHooksFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape,
box.x2 = maxX + 1 + pDrawable->x;
box.y2 = maxY + 1 + pDrawable->y;
- REGION_INIT(pGC->pScreen, &reg, &box, 0);
- REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip);
+ RegionInitBoxes(&reg, &box, 1);
+ RegionIntersect(&reg, &reg, pGC->pCompositeClip);
(*pGC->ops->FillPolygon) (pDrawable, pGC, shape, mode, count, pts);
add_changed(pGC->pScreen, &reg);
- REGION_UNINIT(pGC->pScreen, &reg);
+ RegionUninit(&reg);
out:
GC_OP_EPILOGUE(pGC);
@@ -1995,13 +1993,13 @@ static void vncHooksPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrects,
}
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);
add_changed(pGC->pScreen, reg);
- REGION_DESTROY(pGC->pScreen, reg);
+ RegionDestroy(reg);
out:
GC_OP_EPILOGUE(pGC);
@@ -2070,13 +2068,13 @@ static void vncHooksPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs,
}
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);
add_changed(pGC->pScreen, reg);
- REGION_DESTROY(pGC->pScreen, reg);
+ RegionDestroy(reg);
out:
GC_OP_EPILOGUE(pGC);
@@ -2121,14 +2119,14 @@ static int vncHooksPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
GetTextBoundingRect(pDrawable, pGC->font, x, y, count, &box);
- REGION_INIT(pGC->pScreen, &reg, &box, 0);
- REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip);
+ RegionInitBoxes(&reg, &box, 1);
+ RegionIntersect(&reg, &reg, pGC->pCompositeClip);
ret = (*pGC->ops->PolyText8) (pDrawable, pGC, x, y, count, chars);
add_changed(pGC->pScreen, &reg);
- REGION_UNINIT(pGC->pScreen, &reg);
+ RegionUninit(&reg);
out:
GC_OP_EPILOGUE(pGC);
@@ -2155,14 +2153,14 @@ static int vncHooksPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
GetTextBoundingRect(pDrawable, pGC->font, x, y, count, &box);
- REGION_INIT(pGC->pScreen, &reg, &box, 0);
- REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip);
+ RegionInitBoxes(&reg, &box, 1);
+ RegionIntersect(&reg, &reg, pGC->pCompositeClip);
ret = (*pGC->ops->PolyText16) (pDrawable, pGC, x, y, count, chars);
add_changed(pGC->pScreen, &reg);
- REGION_UNINIT(pGC->pScreen, &reg);
+ RegionUninit(&reg);
out:
GC_OP_EPILOGUE(pGC);
@@ -2188,14 +2186,14 @@ static void vncHooksImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
GetTextBoundingRect(pDrawable, pGC->font, x, y, count, &box);
- REGION_INIT(pGC->pScreen, &reg, &box, 0);
- REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip);
+ RegionInitBoxes(&reg, &box, 1);
+ RegionIntersect(&reg, &reg, pGC->pCompositeClip);
(*pGC->ops->ImageText8) (pDrawable, pGC, x, y, count, chars);
add_changed(pGC->pScreen, &reg);
- REGION_UNINIT(pGC->pScreen, &reg);
+ RegionUninit(&reg);
out:
GC_OP_EPILOGUE(pGC);
@@ -2219,14 +2217,14 @@ static void vncHooksImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
GetTextBoundingRect(pDrawable, pGC->font, x, y, count, &box);
- REGION_INIT(pGC->pScreen, &reg, &box, 0);
- REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip);
+ RegionInitBoxes(&reg, &box, 1);
+ RegionIntersect(&reg, &reg, pGC->pCompositeClip);
(*pGC->ops->ImageText16) (pDrawable, pGC, x, y, count, chars);
add_changed(pGC->pScreen, &reg);
- REGION_UNINIT(pGC->pScreen, &reg);
+ RegionUninit(&reg);
out:
GC_OP_EPILOGUE(pGC);
@@ -2251,14 +2249,14 @@ static void vncHooksImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x,
GetTextBoundingRect(pDrawable, pGC->font, x, y, nglyph, &box);
- REGION_INIT(pGC->pScreen, &reg, &box, 0);
- REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip);
+ RegionInitBoxes(&reg, &box, 1);
+ RegionIntersect(&reg, &reg, pGC->pCompositeClip);
(*pGC->ops->ImageGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
add_changed(pGC->pScreen, &reg);
- REGION_UNINIT(pGC->pScreen, &reg);
+ RegionUninit(&reg);
out:
GC_OP_EPILOGUE(pGC);
@@ -2283,14 +2281,14 @@ static void vncHooksPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x,
GetTextBoundingRect(pDrawable, pGC->font, x, y, nglyph, &box);
- REGION_INIT(pGC->pScreen, &reg, &box, 0);
- REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip);
+ RegionInitBoxes(&reg, &box, 1);
+ RegionIntersect(&reg, &reg, pGC->pCompositeClip);
(*pGC->ops->PolyGlyphBlt) (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
add_changed(pGC->pScreen, &reg);
- REGION_UNINIT(pGC->pScreen, &reg);
+ RegionUninit(&reg);
out:
GC_OP_EPILOGUE(pGC);
@@ -2313,14 +2311,14 @@ static void vncHooksPushPixels(GCPtr pGC, PixmapPtr pBitMap,
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
- REGION_INIT(pGC->pScreen, &reg, &box, 0);
- REGION_INTERSECT(pGC->pScreen, &reg, &reg, pGC->pCompositeClip);
+ RegionInitBoxes(&reg, &box, 1);
+ RegionIntersect(&reg, &reg, pGC->pCompositeClip);
(*pGC->ops->PushPixels) (pGC, pBitMap, pDrawable, w, h, x, y);
add_changed(pGC->pScreen, &reg);
- REGION_UNINIT(pGC->pScreen, &reg);
+ RegionUninit(&reg);
GC_OP_EPILOGUE(pGC);
}
diff --git a/unix/xserver/hw/vnc/xvnc.c b/unix/xserver/hw/vnc/xvnc.c
index 8c0d77d0..46ee4a32 100644
--- a/unix/xserver/hw/vnc/xvnc.c
+++ b/unix/xserver/hw/vnc/xvnc.c
@@ -943,8 +943,8 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable)
{
RegionPtr borderVisible;
- borderVisible = REGION_CREATE(pScreen, NullBox, 1);
- REGION_SUBTRACT(pScreen, borderVisible,
+ borderVisible = RegionCreate(NullBox, 1);
+ RegionSubtract(borderVisible,
&pWin->borderClip, &pWin->winSize);
pWin->valdata->before.borderVisible = borderVisible;
}
@@ -953,7 +953,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
* it doesn't...)
*/
@@ -963,18 +963,18 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable)
box.y1 = 0;
box.x2 = pScreen->width;
box.y2 = pScreen->height;
- REGION_INIT (pScreen, &pWin->winSize, &box, 1);
- REGION_INIT (pScreen, &pWin->borderSize, &box, 1);
+ RegionInit(&pWin->winSize, &box, 1);
+ RegionInit(&pWin->borderSize, &box, 1);
if (WasViewable)
- REGION_RESET(pScreen, &pWin->borderClip, &box);
+ RegionReset(&pWin->borderClip, &box);
pWin->drawable.width = pScreen->width;
pWin->drawable.height = pScreen->height;
- REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
+ RegionBreak(&pWin->clipList);
}
else
{
- REGION_EMPTY(pScreen, &pWin->borderClip);
- REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
+ RegionEmpty(&pWin->borderClip);
+ RegionBreak(&pWin->clipList);
}
ResizeChildrenWinSize (pWin, 0, 0, 0, 0);