diff --git a/unix/Xvnc/programs/Xserver/hw/vnc/draw.c b/unix/Xvnc/programs/Xserver/hw/vnc/draw.c index 038a61062..daa06b2ef 100644 --- a/unix/Xvnc/programs/Xserver/hw/vnc/draw.c +++ b/unix/Xvnc/programs/Xserver/hw/vnc/draw.c @@ -112,7 +112,10 @@ static inline Bool is_visible(DrawablePtr drawable) */ /****************************************************************************/ -#define TRC(x) /* (rfbLog x) */ +#define TRC(...) /* rfbLog(__VA_ARGS__) */ +#define TRC_REGION(...) /* PrintRegion(__VA_ARGS__, FALSE) */ + +#define XID(drawable) (drawable ? drawable->id : 0) /* ADD_TO_MODIFIED_REGION adds the given region to the modified region for each client */ @@ -314,7 +317,7 @@ Bool rfbCloseScreen(ScreenPtr pScreen) pScreen->StoreColors = prfb->StoreColors; pScreen->SaveScreen = prfb->SaveScreen; - TRC((stderr, "Unwrapped screen functions\n")); + TRC("rfbCloseScreen(): Unwrapped screen functions\n"); return (*pScreen->CloseScreen) (pScreen); } @@ -327,7 +330,8 @@ void rfbSourceValidate(DrawablePtr pDrawable, int x, int y, int width, { SCREEN_PROLOGUE(pDrawable->pScreen, SourceValidate); - TRC((stderr, "rfbSourceValidate called\n")); + TRC("rfbSourceValidate() x=%d y=%d width=%d height=%d subWindowMode=%u\n", + x, y, width, height, subWindowMode); rfbDRI3SyncBOToDrawable(pDrawable); @@ -355,7 +359,7 @@ Bool rfbCreateGC(GCPtr pGC) ret = (*pScreen->CreateGC) (pGC); - TRC((stderr, "rfbCreateGC called\n")); + TRC("rfbCreateGC() pGC=0x%.8lx\n", (unsigned long)pGC); pGCPriv->wrapOps = NULL; pGCPriv->wrapFuncs = pGC->funcs; @@ -385,7 +389,9 @@ void rfbCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) SCREEN_PROLOGUE(pWin->drawable.pScreen, CopyWindow); - TRC((stderr, "rfbCopyWindow called\n")); + TRC("rfbCopyWindow() Win=0x%.8x ptOldOrg={%d, %d}\n", pWin->drawable.id, + ptOldOrg.x, ptOldOrg.y); + TRC_REGION(pScreen, pOldRegion, "rfbCopyWindow() pOldRegion"); dx = pWin->drawable.x - ptOldOrg.x; dy = pWin->drawable.y - ptOldOrg.y; @@ -414,6 +420,8 @@ void rfbCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) } } + TRC_REGION(pScreen, &dstRegion, "rfbCopyWindow() mod"); + REGION_UNINIT(pSrc->pScreen, &dstRegion); (*pScreen->CopyWindow) (pWin, ptOldOrg, pOldRegion); @@ -437,7 +445,8 @@ void rfbClearToBackground(WindowPtr pWin, int x, int y, int w, int h, SCREEN_PROLOGUE(pWin->drawable.pScreen, ClearToBackground); - TRC((stderr, "rfbClearToBackground called\n")); + TRC("rfbClearToBackground() Win=0x%.8x x=%d y=%d w=%d h=%d generateExposures=%d\n", + pWin->drawable.id, x, y, w, h, generateExposures); if (!generateExposures) { box.x1 = x + pWin->drawable.x; @@ -451,6 +460,8 @@ void rfbClearToBackground(WindowPtr pWin, int x, int y, int w, int h, ADD_TO_MODIFIED_REGION(pScreen, &tmpRegion); + TRC_REGION(pScreen, &tmpRegion, "rfbClearToBackground() mod"); + REGION_UNINIT(pScreen, &tmpRegion); } @@ -498,7 +509,8 @@ static void rfbValidateGC(GCPtr pGC, unsigned long changes, { GC_FUNC_PROLOGUE(pGC); - TRC((stderr, "rfbValidateGC called\n")); + TRC("rfbValidateGC() pGC=0x%.8lx changes=%ul Drawable=0x%.8x\n", + (unsigned long)pGC, changes, XID(pDrawable)); (*pGC->funcs->ValidateGC) (pGC, changes, pDrawable); @@ -511,12 +523,12 @@ static void rfbValidateGC(GCPtr pGC, unsigned long changes, pRegion = &pWin->borderClip; if (REGION_NOTEMPTY(pDrawable->pScreen, pRegion)) { pGCPriv->wrapOps = pGC->ops; - TRC((stderr, "rfbValidateGC: wrapped GC ops\n")); + TRC("rfbValidateGC(): wrapped GC ops\n"); } } else if (pDrawable == &pGC->pScreen->GetScreenPixmap(pGC->pScreen)->drawable) { pGCPriv->wrapOps = pGC->ops; - TRC((stderr, "rfbValidateGC: wrapped GC ops\n")); + TRC("rfbValidateGC(): wrapped GC ops\n"); } GC_FUNC_EPILOGUE(pGC); @@ -607,7 +619,8 @@ static void rfbFillSpans(DrawablePtr pDrawable, GCPtr pGC, { GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbFillSpans called\n")); + TRC("rfbFillSpans() Drawable=0x%.8x pGC=0x%.8lx\n", XID(pDrawable), + (unsigned long)pGC); if (pDrawable->type == DRAWABLE_WINDOW) { RegionRec changed; @@ -616,9 +629,11 @@ static void rfbFillSpans(DrawablePtr pDrawable, GCPtr pGC, REGION_INTERSECT(pDrawable->pScreen, &changed, &changed, &((WindowPtr)pDrawable)->borderClip); ADD_TO_MODIFIED_REGION(pDrawable->pScreen, &changed); + TRC_REGION(pDrawable->pScreen, &changed, "rfbFillSpans() mod"); REGION_UNINIT(pDrawable->pScreen, &changed); } else { ADD_TO_MODIFIED_REGION(pDrawable->pScreen, pGC->pCompositeClip); + TRC_REGION(pDrawable->pScreen, pGC->pCompositeClip, "rfbFillSpans() mod"); } #ifdef DRI3 @@ -647,7 +662,8 @@ static void rfbSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *psrc, { GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbSetSpans called\n")); + TRC("rfbSetSpans() Drawable=0x%.8x pGC=0x%.8lx\n", XID(pDrawable), + (unsigned long)pGC); if (pDrawable->type == DRAWABLE_WINDOW) { RegionRec changed; @@ -656,9 +672,11 @@ static void rfbSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *psrc, REGION_INTERSECT(pDrawable->pScreen, &changed, &changed, &((WindowPtr)pDrawable)->borderClip); ADD_TO_MODIFIED_REGION(pDrawable->pScreen, &changed); + TRC_REGION(pDrawable->pScreen, &changed, "rfbSetSpans() mod"); REGION_UNINIT(pDrawable->pScreen, &changed); } else { ADD_TO_MODIFIED_REGION(pDrawable->pScreen, pGC->pCompositeClip); + TRC_REGION(pDrawable->pScreen, pGC->pCompositeClip, "rfbSetSpans() mod"); } #ifdef DRI3 @@ -691,7 +709,8 @@ static void rfbPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbPutImage called\n")); + TRC("rfbPutImage() Drawable=0x%.8x pGC=0x%.8lx depth=%d x=%d y=%d w=%d h=%d leftPad=%d format=%d\n", + XID(pDrawable), (unsigned long)pGC, depth, x, y, w, h, leftPad, format); box.x1 = x + pDrawable->x; box.y1 = y + pDrawable->y; @@ -706,6 +725,8 @@ static void rfbPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, ADD_TO_MODIFIED_REGION(pDrawable->pScreen, &tmpRegion); ADD_TO_ALR_REGION(pDrawable->pScreen, &tmpRegion); + TRC_REGION(pDrawable->pScreen, &tmpRegion, "rfbPutImage() mod"); + REGION_UNINIT(pDrawable->pScreen, &tmpRegion); #ifdef DRI3 @@ -744,7 +765,8 @@ static RegionPtr rfbCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, GC_OP_PROLOGUE(pDst, pGC); - TRC((stderr, "rfbCopyArea called\n")); + TRC("rfbCopyArea() Src=0x%.8x Dst=0x%.8x pGC=0x%.8lx srcx=%d srcy=%d w=%d h=%d dstx=%d dsty=%d\n", + XID(pSrc), XID(pDst), (unsigned long)pGC, srcx, srcy, w, h, dstx, dsty); box.x1 = dstx + pDst->x; box.y1 = dsty + pDst->y; @@ -788,6 +810,8 @@ static RegionPtr rfbCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, ADD_TO_MODIFIED_REGION(pDst->pScreen, &dstRegion); } + TRC_REGION(pDst->pScreen, &dstRegion, "rfbCopyArea() mod"); + REGION_UNINIT(pDst->pScreen, &dstRegion); #ifdef DRI3 @@ -824,7 +848,9 @@ static RegionPtr rfbCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GC_OP_PROLOGUE(pDst, pGC); - TRC((stderr, "rfbCopyPlane called\n")); + TRC("rfbCopyPlane() Src=0x%.8x Dst=0x%.8x pGC=0x%.8lx srcx=%d srcy=%d w=%d h=%d dstx=%d dsty=%d plane=%lu\n", + XID(pSrc), XID(pDst), (unsigned long)pGC, srcx, srcy, w, h, dstx, dsty, + plane); box.x1 = dstx + pDst->x; box.y1 = dsty + pDst->y; @@ -837,6 +863,8 @@ static RegionPtr rfbCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, ADD_TO_MODIFIED_REGION(pDst->pScreen, &tmpRegion); + TRC_REGION(pDst->pScreen, &tmpRegion, "rfbCopyPlane() mod"); + REGION_UNINIT(pDst->pScreen, &tmpRegion); #ifdef DRI3 @@ -873,7 +901,8 @@ static void rfbPolyPoint(DrawablePtr pDrawable, GCPtr pGC, GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbPolyPoint called\n")); + TRC("rfbPolyPoint() Drawable=0x%.8x pGC=0x%.8lx\n", XID(pDrawable), + (unsigned long)pGC); if (npt) { int minX = pts[0].x, maxX = pts[0].x; @@ -911,6 +940,8 @@ static void rfbPolyPoint(DrawablePtr pDrawable, GCPtr pGC, ADD_TO_MODIFIED_REGION(pDrawable->pScreen, &tmpRegion); + TRC_REGION(pDrawable->pScreen, &tmpRegion, "rfbPolyPoint() mod"); + REGION_UNINIT(pDrawable->pScreen, &tmpRegion); } @@ -945,7 +976,8 @@ static void rfbPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbPolylines called\n")); + TRC("rfbPolyLines() Drawable=0x%.8x pGC=0x%.8lx\n", XID(pDrawable), + (unsigned long)pGC); if (npt) { lw = pGC->lineWidth; @@ -1014,6 +1046,8 @@ static void rfbPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, ADD_TO_MODIFIED_REGION(pDrawable->pScreen, tmpRegion); + TRC_REGION(pDrawable->pScreen, tmpRegion, "rfbPolyLines() mod"); + REGION_DESTROY(pDrawable->pScreen, tmpRegion); free((char *)rects); } @@ -1049,7 +1083,8 @@ static void rfbPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbPolySegment called\n")); + TRC("rfbPolySegment() Drawable=0x%.8x pGC=0x%.8lx\n", XID(pDrawable), + (unsigned long)pGC); if (nseg) { rects = (xRectangle *)rfbAlloc(nseg * sizeof(xRectangle)); @@ -1084,6 +1119,8 @@ static void rfbPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, ADD_TO_MODIFIED_REGION(pDrawable->pScreen, tmpRegion); + TRC_REGION(pDrawable->pScreen, tmpRegion, "rfbPolySegment() mod"); + REGION_DESTROY(pDrawable->pScreen, tmpRegion); free((char *)rects); } @@ -1119,7 +1156,8 @@ static void rfbPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects, GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbPolyRectangle called\n")); + TRC("rfbPolyRectangle() Drawable=0x%.8x pGC=0x%.8lx\n", XID(pDrawable), + (unsigned long)pGC); if (nrects) { regRects = (xRectangle *)rfbAlloc(nrects * 4 * sizeof(xRectangle)); @@ -1161,6 +1199,8 @@ static void rfbPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects, ADD_TO_MODIFIED_REGION(pDrawable->pScreen, tmpRegion); + TRC_REGION(pDrawable->pScreen, tmpRegion, "rfbPolyRectangle() mod"); + REGION_DESTROY(pDrawable->pScreen, tmpRegion); free((char *)regRects); } @@ -1196,7 +1236,8 @@ static void rfbPolyArc(DrawablePtr pDrawable, register GCPtr pGC, int narcs, GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbPolyArc called\n")); + TRC("rfbPolyArc() Drawable=0x%.8x pGC=0x%.8lx\n", XID(pDrawable), + (unsigned long)pGC); if (narcs) { rects = (xRectangle *)rfbAlloc(narcs * sizeof(xRectangle)); @@ -1220,6 +1261,8 @@ static void rfbPolyArc(DrawablePtr pDrawable, register GCPtr pGC, int narcs, ADD_TO_MODIFIED_REGION(pDrawable->pScreen, tmpRegion); + TRC_REGION(pDrawable->pScreen, tmpRegion, "rfbPolyArc() mod"); + REGION_DESTROY(pDrawable->pScreen, tmpRegion); free((char *)rects); } @@ -1254,7 +1297,8 @@ static void rfbFillPolygon(register DrawablePtr pDrawable, register GCPtr pGC, GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbFillPolygon called\n")); + TRC("rfbFillPolygon() Drawable=0x%.8x pGC=0x%.8lx\n", XID(pDrawable), + (unsigned long)pGC); if (count) { int minX = pts[0].x, maxX = pts[0].x; @@ -1292,6 +1336,8 @@ static void rfbFillPolygon(register DrawablePtr pDrawable, register GCPtr pGC, ADD_TO_MODIFIED_REGION(pDrawable->pScreen, &tmpRegion); + TRC_REGION(pDrawable->pScreen, &tmpRegion, "rfbFillPolygon() mod"); + REGION_UNINIT(pDrawable->pScreen, &tmpRegion); } @@ -1325,7 +1371,8 @@ static void rfbPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrects, GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbPolyFillRect called\n")); + TRC("rfbPolyFillRect() Drawable=0x%.8x pGC=0x%.8lx\n", XID(pDrawable), + (unsigned long)pGC); if (nrects) { regRects = (xRectangle *)rfbAlloc(nrects * sizeof(xRectangle)); @@ -1343,6 +1390,8 @@ static void rfbPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrects, ADD_TO_MODIFIED_REGION(pDrawable->pScreen, tmpRegion); + TRC_REGION(pDrawable->pScreen, tmpRegion, "rfbPolyFillRect() mod"); + REGION_DESTROY(pDrawable->pScreen, tmpRegion); free((char *)regRects); } @@ -1378,7 +1427,8 @@ static void rfbPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbPolyFillArc called\n")); + TRC("rfbPolyFillArc() Drawable=0x%.8x pGC=0x%.8lx\n", XID(pDrawable), + (unsigned long)pGC); if (narcs) { rects = (xRectangle *)rfbAlloc(narcs * sizeof(xRectangle)); @@ -1402,6 +1452,8 @@ static void rfbPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, ADD_TO_MODIFIED_REGION(pDrawable->pScreen, tmpRegion); + TRC_REGION(pDrawable->pScreen, tmpRegion, "rfbPolyFillArc() mod"); + REGION_DESTROY(pDrawable->pScreen, tmpRegion); free((char *)rects); } @@ -1471,7 +1523,8 @@ static int rfbPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbPolyText8 called '%.*s'\n", count, chars)); + TRC("rfbPolyText8() Drawable=0x%.8x pGC=0x%.8lx x=%d y=%d '%.*s'\n", + XID(pDrawable), (unsigned long)pGC, x, y, count, chars); if (count) { GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); @@ -1483,6 +1536,8 @@ static int rfbPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, ADD_TO_MODIFIED_REGION(pDrawable->pScreen, &tmpRegion); + TRC_REGION(pDrawable->pScreen, &tmpRegion, "rfbPolyText8() mod"); + REGION_UNINIT(pDrawable->pScreen, &tmpRegion); } @@ -1517,7 +1572,8 @@ static int rfbPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbPolyText16 called\n")); + TRC("rfbPolyText16() Drawable=0x%.8x pGC=0x%.8lx x=%d y=%d count=%d\n", + XID(pDrawable), (unsigned long)pGC, x, y, count); if (count) { GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); @@ -1529,6 +1585,8 @@ static int rfbPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, ADD_TO_MODIFIED_REGION(pDrawable->pScreen, &tmpRegion); + TRC_REGION(pDrawable->pScreen, &tmpRegion, "rfbPolyText16() mod"); + REGION_UNINIT(pDrawable->pScreen, &tmpRegion); } @@ -1562,7 +1620,8 @@ static void rfbImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbImageText8 called '%.*s'\n", count, chars)); + TRC("rfbImageText8() Drawable=0x%.8x pGC=0x%.8lx x=%d y=%d '%.*s'\n", + XID(pDrawable), (unsigned long)pGC, x, y, count, chars); if (count) { GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); @@ -1574,6 +1633,8 @@ static void rfbImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, ADD_TO_MODIFIED_REGION(pDrawable->pScreen, &tmpRegion); + TRC_REGION(pDrawable->pScreen, &tmpRegion, "rfbImageText8() mod"); + REGION_UNINIT(pDrawable->pScreen, &tmpRegion); } @@ -1606,7 +1667,8 @@ static void rfbImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbImageText16 called\n")); + TRC("rfbImageText16() Drawable=0x%.8x pGC=0x%.8lx x=%d y=%d count=%d\n", + XID(pDrawable), (unsigned long)pGC, x, y, count); if (count) { GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); @@ -1618,6 +1680,8 @@ static void rfbImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, ADD_TO_MODIFIED_REGION(pDrawable->pScreen, &tmpRegion); + TRC_REGION(pDrawable->pScreen, &tmpRegion, "rfbImageText16() mod"); + REGION_UNINIT(pDrawable->pScreen, &tmpRegion); } @@ -1652,7 +1716,8 @@ static void rfbImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbImageGlyphBlt called\n")); + TRC("rfbImageGlyphBlt() Drawable=0x%.8x pGC=0x%.8lx x=%d y=%d nglyph=%d\n", + XID(pDrawable), (unsigned long)pGC, x, y, nglyph); if (nglyph) { GetTextBoundingBox(pDrawable, pGC->font, x, y, nglyph, &box); @@ -1664,6 +1729,8 @@ static void rfbImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, ADD_TO_MODIFIED_REGION(pDrawable->pScreen, &tmpRegion); + TRC_REGION(pDrawable->pScreen, &tmpRegion, "rfbImageGlyphBlt() mod"); + REGION_UNINIT(pDrawable->pScreen, &tmpRegion); } @@ -1698,7 +1765,8 @@ static void rfbPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbPolyGlyphBlt called\n")); + TRC("rfbPolyGlyphBlt() Drawable=0x%.8x pGC=0x%.8lx x=%d y=%d nglyph=%d\n", + XID(pDrawable), (unsigned long)pGC, x, y, nglyph); if (nglyph) { GetTextBoundingBox(pDrawable, pGC->font, x, y, nglyph, &box); @@ -1710,6 +1778,8 @@ static void rfbPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, ADD_TO_MODIFIED_REGION(pDrawable->pScreen, &tmpRegion); + TRC_REGION(pDrawable->pScreen, &tmpRegion, "rfbPolyGlyphBlt() mod"); + REGION_UNINIT(pDrawable->pScreen, &tmpRegion); } @@ -1743,7 +1813,8 @@ static void rfbPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable, GC_OP_PROLOGUE(pDrawable, pGC); - TRC((stderr, "rfbPushPixels called\n")); + TRC("rfbPushPixels() pGC=0x%.8lx Drawable=0x%.8x w=%d h=%d x=%d y=%d\n", + (unsigned long)pGC, XID(pDrawable), w, h, x, y); box.x1 = x + pDrawable->x; box.y1 = y + pDrawable->y; @@ -1757,6 +1828,8 @@ static void rfbPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable, ADD_TO_MODIFIED_REGION(pDrawable->pScreen, &tmpRegion); + TRC_REGION(pDrawable->pScreen, &tmpRegion, "rfbPushPixels() mod"); + REGION_UNINIT(pDrawable->pScreen, &tmpRegion); #ifdef DRI3 @@ -1787,6 +1860,10 @@ void rfbComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, BoxRec box; PictureScreenPtr ps = GetPictureScreen(pScreen); + TRC("rfbComposite() op=%d Src=0x%.8x Dst=0x%.8x xSrc=%d ySrc=%d xMask=0x%.4x yMask=0x%.4x xDst=%d yDst=%d width=%d height=%d\n", + op, XID(pSrc->pDrawable), XID(pDst->pDrawable), xSrc, ySrc, xMask, yMask, + xDst, yDst, width, height); + if (is_visible(pDst->pDrawable)) { box.x1 = max(pDst->pDrawable->x + xDst, 0); box.y1 = max(pDst->pDrawable->y + yDst, 0); @@ -1805,6 +1882,8 @@ void rfbComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, REGION_INTERSECT(pScreen, &tmpRegion, &tmpRegion, &fbRegion); ADD_TO_MODIFIED_REGION(pScreen, &tmpRegion); + + TRC_REGION(pScreen, &tmpRegion, "rfbComposite() mod"); } #ifdef DRI3 @@ -1888,6 +1967,9 @@ void rfbGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, RegionRec *tmpRegion = NULL; PictureScreenPtr ps = GetPictureScreen(pScreen); + TRC("rfbGlyphs() op=%d Src=0x%.8x Dst=0x%.8x xSrc=%d ySrc=%d nlists=%d\n", + op, XID(pSrc->pDrawable), XID(pDst->pDrawable), xSrc, ySrc, nlists); + if (is_visible(pDst->pDrawable)) { BoxRec fbBox; RegionRec fbRegion; @@ -1908,6 +1990,8 @@ void rfbGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, ADD_TO_MODIFIED_REGION(pScreen, tmpRegion); + TRC_REGION(pScreen, tmpRegion, "rfbGlyphs() mod"); + REGION_DESTROY(pScreen, tmpRegion); } @@ -1938,6 +2022,9 @@ void rfbCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color, rfbFBInfoPtr prfb = &rfbFB; PictureScreenPtr ps = GetPictureScreen(pScreen); + TRC("rfbCompositeRects() op=%d Dst=0x%.8x nRect=%d\n", op, + XID(pDst->pDrawable), nRect); + rfbDRI3SyncBOToDrawable(pDst->pDrawable); ps->CompositeRects = prfb->CompositeRects; @@ -1956,6 +2043,9 @@ void rfbTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, rfbFBInfoPtr prfb = &rfbFB; PictureScreenPtr ps = GetPictureScreen(pScreen); + TRC("rfbTrapezoids() op=%d Src=0x%.8x Dst=0x%.8x xSrc=%d ySrc=%d ntrap=%d\n", + op, XID(pSrc->pDrawable), XID(pDst->pDrawable), xSrc, ySrc, ntrap); + rfbDRI3SyncBOToDrawable(pDst->pDrawable); ps->Trapezoids = prfb->Trapezoids; @@ -1974,6 +2064,9 @@ void rfbTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst, rfbFBInfoPtr prfb = &rfbFB; PictureScreenPtr ps = GetPictureScreen(pScreen); + TRC("rfbTriangles() op=%d Src=0x%.8x Dst=0x%.8x xSrc=%d ySrc=%d ntri=%d\n", + op, XID(pSrc->pDrawable), XID(pDst->pDrawable), xSrc, ySrc, ntri); + rfbDRI3SyncBOToDrawable(pDst->pDrawable); ps->Triangles = prfb->Triangles; @@ -1992,6 +2085,9 @@ void rfbTriStrip(CARD8 op, PicturePtr pSrc, PicturePtr pDst, rfbFBInfoPtr prfb = &rfbFB; PictureScreenPtr ps = GetPictureScreen(pScreen); + TRC("rfbTriStrip() op=%d Src=0x%.8x Dst=0x%.8x xSrc=%d ySrc=%d npoint=%d\n", + op, XID(pSrc->pDrawable), XID(pDst->pDrawable), xSrc, ySrc, npoint); + rfbDRI3SyncBOToDrawable(pDst->pDrawable); ps->TriStrip = prfb->TriStrip; @@ -2010,6 +2106,9 @@ void rfbTriFan(CARD8 op, PicturePtr pSrc, PicturePtr pDst, rfbFBInfoPtr prfb = &rfbFB; PictureScreenPtr ps = GetPictureScreen(pScreen); + TRC("rfbTriFan() op=%d Src=0x%.8x Dst=0x%.8x xSrc=%d ySrc=%d npoint=%d\n", + op, XID(pSrc->pDrawable), XID(pDst->pDrawable), xSrc, ySrc, npoint); + rfbDRI3SyncBOToDrawable(pDst->pDrawable); ps->TriFan = prfb->TriFan; @@ -2063,6 +2162,10 @@ static void rfbCopyRegion(ScreenPtr pScreen, rfbClientPtr cl, RegionPtr src, { RegionRec tmp; + TRC("%d: rfbCopyRegion() dx=%d dy=%d\n", cl->id, dx, dy); + TRC_REGION(pScreen, src, "rfbCopyRegion() src"); + TRC_REGION(pScreen, dst, "rfbCopyRegion() dst"); + /* src = src - modifiedRegion */ REGION_SUBTRACT(pScreen, src, src, &cl->modifiedRegion); @@ -2190,17 +2293,20 @@ static void rfbScheduleDeferredUpdate(rfbClientPtr cl) * PrintRegion is useful for debugging. */ -void PrintRegion(ScreenPtr pScreen, RegionPtr reg, const char *msg) +void PrintRegion(ScreenPtr pScreen, RegionPtr reg, const char *msg, + Bool printRects) { int nrects = REGION_NUM_RECTS(reg); int i; - rfbLog("Region %s num rects %d extents %d,%d %d,%d\n", msg, nrects, + rfbLog("%s: num rects %d extents %d,%d %d,%d\n", msg, nrects, (REGION_EXTENTS(pScreen, reg))->x1, (REGION_EXTENTS(pScreen, reg))->y1, (REGION_EXTENTS(pScreen, reg))->x2, (REGION_EXTENTS(pScreen, reg))->y2); + if (!printRects) return; + for (i = 0; i < nrects; i++) { rfbLog(" rect %d,%d %dx%d\n", REGION_RECTS(reg)[i].x1, diff --git a/unix/Xvnc/programs/Xserver/hw/vnc/rfb.h b/unix/Xvnc/programs/Xserver/hw/vnc/rfb.h index 009d8a3b6..9ef4625a5 100644 --- a/unix/Xvnc/programs/Xserver/hw/vnc/rfb.h +++ b/unix/Xvnc/programs/Xserver/hw/vnc/rfb.h @@ -824,7 +824,8 @@ extern Bool rfbDCInitialize(ScreenPtr, miPointerScreenFuncPtr); extern int rfbDeferUpdateTime; extern void ClipToScreen(ScreenPtr pScreen, RegionPtr pRegion); -void PrintRegion(ScreenPtr pScreen, RegionPtr reg, const char *msg); +void PrintRegion(ScreenPtr pScreen, RegionPtr reg, const char *msg, + Bool printRects); #ifdef RENDER extern void rfbComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,