diff --git a/common/os_calls.c b/common/os_calls.c index 2d5b4280..bb26d246 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -42,6 +42,8 @@ #include #include #include +#include +#include #include #include #include @@ -3118,3 +3120,17 @@ g_text2bool(const char *s) } return 0; } + +/*****************************************************************************/ +void * APP_CC +g_shmat(int shmid) +{ + return shmat(shmid, 0, 0); +} + +/*****************************************************************************/ +int APP_CC +g_shmdt(const void *shmaddr) +{ + return shmdt(shmaddr); +} diff --git a/common/os_calls.h b/common/os_calls.h index b6e1c91a..2bee6077 100644 --- a/common/os_calls.h +++ b/common/os_calls.h @@ -161,5 +161,7 @@ int APP_CC g_time1(void); int APP_CC g_time2(void); int APP_CC g_time3(void); int APP_CC g_text2bool(const char *s); +void * APP_CC g_shmat(int shmid); +int APP_CC g_shmdt(const void *shmaddr); #endif diff --git a/xorg/server/module/Makefile b/xorg/server/module/Makefile index 93363e46..9003de4d 100644 --- a/xorg/server/module/Makefile +++ b/xorg/server/module/Makefile @@ -5,7 +5,8 @@ rdpPolyRectangle.o rdpPolyArc.o rdpFillPolygon.o rdpPolyFillRect.o \ rdpPolyFillArc.o rdpPolyText8.o rdpPolyText16.o rdpImageText8.o \ rdpImageText16.o rdpImageGlyphBlt.o rdpPolyGlyphBlt.o rdpPushPixels.o \ rdpCursor.o rdpMain.o rdpRandR.o rdpMisc.o rdpReg.o \ -rdpComposite.o rdpGlyphs.o rdpPixmap.o rdpInput.o rdpClientCon.o rdpCapture.o +rdpComposite.o rdpGlyphs.o rdpPixmap.o rdpInput.o rdpClientCon.o rdpCapture.o \ +rdpTrapezoids.o CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 \ -I../../../common diff --git a/xorg/server/module/rdp.h b/xorg/server/module/rdp.h index 7f055488..a26d4deb 100644 --- a/xorg/server/module/rdp.h +++ b/xorg/server/module/rdp.h @@ -149,7 +149,8 @@ struct _rdpCounts CARD32 rdpPushPixelsCallCount; /* 20 */ CARD32 rdpCompositeCallCount; CARD32 rdpCopyWindowCallCount; /* 22 */ - CARD32 callCount[64 - 22]; + CARD32 rdpTrapezoidsCallCount; + CARD32 callCount[64 - 23]; }; /* move this to common header */ @@ -177,6 +178,7 @@ struct _rdpRec CloseScreenProcPtr CloseScreen; CompositeProcPtr Composite; GlyphsProcPtr Glyphs; + TrapezoidsProcPtr Trapezoids; /* keyboard and mouse */ miPointerScreenFuncPtr pCursorFuncs; diff --git a/xorg/server/module/rdpClientCon.c b/xorg/server/module/rdpClientCon.c index 922e1e8e..c02e9f1e 100644 --- a/xorg/server/module/rdpClientCon.c +++ b/xorg/server/module/rdpClientCon.c @@ -2076,3 +2076,45 @@ rdpClientConSendArea(rdpPtr dev, rdpClientCon *clientCon, } } } + +/******************************************************************************/ +int +rdpClientConAddAllReg(rdpPtr dev, RegionPtr reg, DrawablePtr pDrawable) +{ + rdpClientCon *clientCon; + Bool drw_is_vis; + + drw_is_vis = XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable); + if (!drw_is_vis) + { + return 0; + } + clientCon = dev->clientConHead; + while (clientCon != NULL) + { + rdpClientConAddDirtyScreenReg(dev, clientCon, reg); + clientCon = clientCon->next; + } + return 0; +} + +/******************************************************************************/ +int +rdpClientConAddAllBox(rdpPtr dev, BoxPtr box, DrawablePtr pDrawable) +{ + rdpClientCon *clientCon; + Bool drw_is_vis; + + drw_is_vis = XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable); + if (!drw_is_vis) + { + return 0; + } + clientCon = dev->clientConHead; + while (clientCon != NULL) + { + rdpClientConAddDirtyScreenBox(dev, clientCon, box); + clientCon = clientCon->next; + } + return 0; +} diff --git a/xorg/server/module/rdpClientCon.h b/xorg/server/module/rdpClientCon.h index 23f51378..592e8d31 100644 --- a/xorg/server/module/rdpClientCon.h +++ b/xorg/server/module/rdpClientCon.h @@ -143,6 +143,9 @@ rdpClientConAddDirtyScreenBox(rdpPtr dev, rdpClientCon *clientCon, int rdpClientConAddDirtyScreen(rdpPtr dev, rdpClientCon *clientCon, int x, int y, int cx, int cy); - +int +rdpClientConAddAllReg(rdpPtr dev, RegionPtr reg, DrawablePtr pDrawable); +int +rdpClientConAddAllBox(rdpPtr dev, BoxPtr box, DrawablePtr pDrawable); #endif diff --git a/xorg/server/module/rdpComposite.c b/xorg/server/module/rdpComposite.c index 9b5125d4..7535d6c3 100644 --- a/xorg/server/module/rdpComposite.c +++ b/xorg/server/module/rdpComposite.c @@ -32,6 +32,7 @@ composite(alpha blending) calls #include #include +#include "mipict.h" #include #include "rdp.h" @@ -45,17 +46,6 @@ composite(alpha blending) calls #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) -/******************************************************************************/ -static void -rdpCompositePre(rdpPtr dev, rdpClientCon *clientCon, - PictureScreenPtr ps, CARD8 op, PicturePtr pSrc, - PicturePtr pMask, PicturePtr pDst, - INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, - INT16 xDst, INT16 yDst, CARD16 width, CARD16 height, - BoxPtr box) -{ -} - /******************************************************************************/ static void rdpCompositeOrg(PictureScreenPtr ps, rdpPtr dev, @@ -69,30 +59,6 @@ rdpCompositeOrg(PictureScreenPtr ps, rdpPtr dev, ps->Composite = rdpComposite; } -/******************************************************************************/ -static void -rdpCompositePost(rdpPtr dev, rdpClientCon *clientCon, - PictureScreenPtr ps, CARD8 op, PicturePtr pSrc, - PicturePtr pMask, PicturePtr pDst, - INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, - INT16 xDst, INT16 yDst, CARD16 width, CARD16 height, - BoxPtr box) -{ - RegionRec reg; - - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDst->pDrawable)) - { - return; - } - rdpRegionInit(®, box, 0); - if (pDst->pCompositeClip != 0) - { - rdpRegionIntersect(®, pDst->pCompositeClip, ®); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, ®); - rdpRegionUninit(®); -} - /******************************************************************************/ void rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, @@ -101,36 +67,27 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, { ScreenPtr pScreen; rdpPtr dev; - rdpClientCon *clientCon; PictureScreenPtr ps; BoxRec box; + RegionRec reg; LLOGLN(10, ("rdpComposite:")); - pScreen = pSrc->pDrawable->pScreen; + pScreen = pDst->pDrawable->pScreen; dev = rdpGetDevFromScreen(pScreen); dev->counts.rdpCompositeCallCount++; box.x1 = xDst + pDst->pDrawable->x; box.y1 = yDst + pDst->pDrawable->y; box.x2 = box.x1 + width; box.y2 = box.y1 + height; - ps = GetPictureScreen(pScreen); - clientCon = dev->clientConHead; - while (clientCon != NULL) + rdpRegionInit(®, &box, 0); + if (pDst->pCompositeClip != NULL) { - rdpCompositePre(dev, clientCon, ps, op, pSrc, pMask, pDst, - xSrc, ySrc, xMask, yMask, xDst, yDst, - width, height, &box); - clientCon = clientCon->next; + rdpRegionIntersect(®, pDst->pCompositeClip, ®); } + ps = GetPictureScreen(pScreen); /* do original call */ rdpCompositeOrg(ps, dev, op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); - clientCon = dev->clientConHead; - while (clientCon != NULL) - { - rdpCompositePost(dev, clientCon, ps, op, pSrc, pMask, pDst, - xSrc, ySrc, xMask, yMask, xDst, yDst, - width, height, &box); - clientCon = clientCon->next; - } + rdpClientConAddAllReg(dev, ®, pDst->pDrawable); + rdpRegionUninit(®); } diff --git a/xorg/server/module/rdpCopyArea.c b/xorg/server/module/rdpCopyArea.c index 7257fc3a..708891f6 100644 --- a/xorg/server/module/rdpCopyArea.c +++ b/xorg/server/module/rdpCopyArea.c @@ -39,15 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) -/******************************************************************************/ -static void -rdpCopyAreaPre(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, - int srcx, int srcy, int w, int h, int dstx, int dsty) -{ -} - /******************************************************************************/ static RegionPtr rdpCopyAreaOrg(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, @@ -62,70 +53,40 @@ rdpCopyAreaOrg(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, return rv; } -/******************************************************************************/ -static void -rdpCopyAreaPost(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, - int srcx, int srcy, int w, int h, int dstx, int dsty) -{ - BoxRec box; - RegionRec reg; - - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDst)) - { - return; - } - box.x1 = dstx + pDst->x; - box.y1 = dsty + pDst->y; - box.x2 = box.x1 + w; - box.y2 = box.y1 + h; - rdpRegionInit(®, &box, 0); - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(®, clip_reg, ®); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, ®); - rdpRegionUninit(®); -} - /******************************************************************************/ RegionPtr rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy, int w, int h, int dstx, int dsty) { rdpPtr dev; - rdpClientCon *clientCon; RegionPtr rv; RegionRec clip_reg; + RegionRec reg; int cd; + BoxRec box; LLOGLN(10, ("rdpCopyArea:")); dev = rdpGetDevFromScreen(pGC->pScreen); dev->counts.rdpCopyAreaCallCount++; + box.x1 = dstx + pDst->x; + box.y1 = dsty + pDst->y; + box.x2 = box.x1 + w; + box.y2 = box.y1 + h; + rdpRegionInit(®, &box, 0); rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDst, pGC); LLOGLN(10, ("rdpCopyArea: cd %d", cd)); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd == XRDP_CD_CLIP) { - rdpCopyAreaPre(dev, clientCon, cd, &clip_reg, pSrc, pDst, pGC, - srcx, srcy, w, h, dstx, dsty); - clientCon = clientCon->next; + rdpRegionIntersect(®, &clip_reg, ®); } /* do original call */ rv = rdpCopyAreaOrg(pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd != XRDP_CD_NODRAW) { - rdpCopyAreaPost(dev, clientCon, cd, &clip_reg, pSrc, pDst, pGC, - srcx, srcy, w, h, dstx, dsty); - clientCon = clientCon->next; + rdpClientConAddAllReg(dev, ®, pDst); } rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); return rv; } diff --git a/xorg/server/module/rdpCopyPlane.c b/xorg/server/module/rdpCopyPlane.c index 5783342a..9ccf4c0a 100644 --- a/xorg/server/module/rdpCopyPlane.c +++ b/xorg/server/module/rdpCopyPlane.c @@ -39,16 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) -/******************************************************************************/ -static void -rdpCopyPlanePre(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pSrc, DrawablePtr pDst, - GCPtr pGC, int srcx, int srcy, int w, int h, - int dstx, int dsty, unsigned long bitPlane, BoxPtr box) -{ -} - /******************************************************************************/ static RegionPtr rdpCopyPlaneOrg(DrawablePtr pSrc, DrawablePtr pDst, @@ -65,33 +55,6 @@ rdpCopyPlaneOrg(DrawablePtr pSrc, DrawablePtr pDst, return rv; } -/******************************************************************************/ -static void -rdpCopyPlanePost(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pSrc, DrawablePtr pDst, - GCPtr pGC, int srcx, int srcy, int w, int h, - int dstx, int dsty, unsigned long bitPlane, BoxPtr box) -{ - RegionRec reg; - - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDst)) - { - return; - } - rdpRegionInit(®, box, 0); - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(®, clip_reg, ®); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, ®); - rdpRegionUninit(®); -} - /******************************************************************************/ RegionPtr rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, @@ -100,8 +63,8 @@ rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, { RegionPtr rv; rdpPtr dev; - rdpClientCon *clientCon; RegionRec clip_reg; + RegionRec reg; int cd; BoxRec box; @@ -112,28 +75,22 @@ rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, box.y1 = pDst->y + dsty; box.x2 = box.x1 + w; box.y2 = box.x1 + h; + rdpRegionInit(®, &box, 0); rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDst, pGC); LLOGLN(10, ("rdpCopyPlane: cd %d", cd)); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd == XRDP_CD_CLIP) { - rdpCopyPlanePre(dev, clientCon, cd, &clip_reg, pSrc, pDst, - pGC, srcx, srcy, w, h, - dstx, dsty, bitPlane, &box); - clientCon = clientCon->next; + rdpRegionIntersect(®, &clip_reg, ®); } /* do original call */ rv = rdpCopyPlaneOrg(pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, bitPlane); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd != XRDP_CD_NODRAW) { - rdpCopyPlanePost(dev, clientCon, cd, &clip_reg, pSrc, pDst, - pGC, srcx, srcy, w, h, - dstx, dsty, bitPlane, &box); - clientCon = clientCon->next; + rdpClientConAddAllReg(dev, ®, pDst); } rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); return rv; } diff --git a/xorg/server/module/rdpDraw.c b/xorg/server/module/rdpDraw.c index 5593ad2c..b4e689af 100644 --- a/xorg/server/module/rdpDraw.c +++ b/xorg/server/module/rdpDraw.c @@ -289,7 +289,6 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) { ScreenPtr pScreen; rdpPtr dev; - rdpClientCon *clientCon; RegionRec reg; RegionRec clip; int dx; @@ -297,7 +296,9 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) int num_clip_rects; int num_reg_rects; BoxPtr box; + BoxRec box1; + LLOGLN(10, ("rdpCopyWindow:")); pScreen = pWin->drawable.pScreen; dev = rdpGetDevFromScreen(pScreen); dev->counts.rdpCopyWindowCallCount++; @@ -318,36 +319,33 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) if ((num_clip_rects == 0) || (num_reg_rects == 0)) { - rdpRegionUninit(®); - rdpRegionUninit(&clip); - return; - } - - if ((num_clip_rects > 16) && (num_reg_rects > 16)) - { - box = rdpRegionExtents(®); - clientCon = dev->clientConHead; - while (clientCon != NULL) - { - rdpClientConAddDirtyScreenBox(dev, clientCon, box); - clientCon = clientCon->next; - } } else { - rdpRegionTranslate(®, dx, dy); - rdpRegionIntersect(®, ®, &clip); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if ((num_clip_rects > 16) || (num_reg_rects > 16)) { - rdpClientConAddDirtyScreenReg(dev, clientCon, ®); - clientCon = clientCon->next; + LLOGLN(10, ("rdpCopyWindow: big list")); + box = rdpRegionExtents(®); + box1 = *box; + box1.x1 += dx; + box1.y1 += dy; + box1.x2 += dx; + box1.y2 += dy; + rdpClientConAddAllBox(dev, &box1, &(pWin->drawable)); + } + else + { + rdpRegionTranslate(®, dx, dy); + rdpRegionIntersect(®, ®, &clip); + rdpClientConAddAllReg(dev, ®, &(pWin->drawable)); } } rdpRegionUninit(®); rdpRegionUninit(&clip); } +#if XRDP_CLOSESCR == 1 /* before v1.13 */ + /*****************************************************************************/ Bool rdpCloseScreen(int index, ScreenPtr pScreen) @@ -363,6 +361,25 @@ rdpCloseScreen(int index, ScreenPtr pScreen) return rv; } +#else + +/*****************************************************************************/ +Bool +rdpCloseScreen(ScreenPtr pScreen) +{ + rdpPtr dev; + Bool rv; + + LLOGLN(0, ("rdpCloseScreen:")); + dev = rdpGetDevFromScreen(pScreen); + dev->pScreen->CloseScreen = dev->CloseScreen; + rv = dev->pScreen->CloseScreen(pScreen); + dev->pScreen->CloseScreen = rdpCloseScreen; + return rv; +} + +#endif + /******************************************************************************/ WindowPtr rdpGetRootWindowPtr(ScreenPtr pScreen) diff --git a/xorg/server/module/rdpDraw.h b/xorg/server/module/rdpDraw.h index 05fd0849..af65b46c 100644 --- a/xorg/server/module/rdpDraw.h +++ b/xorg/server/module/rdpDraw.h @@ -25,8 +25,17 @@ misc draw calls #define __RDPDRAW_H #include +#include #include +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0) +/* 1.1, 1.2, 1.3, 1.4 1.5, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11, 1.12 */ +#define XRDP_CLOSESCR 1 +#else +/* 1.13 */ +#define XRDP_CLOSESCR 2 +#endif + /* true if drawable is window or pixmap is screen */ #define XRDP_DRAWABLE_IS_VISIBLE(_dev, _drw) \ (((_drw)->type == DRAWABLE_WINDOW && ((WindowPtr)(_drw))->viewable) || \ @@ -69,8 +78,13 @@ int rdpDrawItemRemoveAll(rdpPtr dev, rdpPixmapRec *priv); void rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion); +#if XRDP_CLOSESCR == 1 Bool rdpCloseScreen(int index, ScreenPtr pScreen); +#else +Bool +rdpCloseScreen(ScreenPtr pScreen); +#endif WindowPtr rdpGetRootWindowPtr(ScreenPtr pScreen); rdpPtr diff --git a/xorg/server/module/rdpFillPolygon.c b/xorg/server/module/rdpFillPolygon.c index c97690d1..34fe4096 100644 --- a/xorg/server/module/rdpFillPolygon.c +++ b/xorg/server/module/rdpFillPolygon.c @@ -39,16 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) -/******************************************************************************/ -void -rdpFillPolygonPre(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, - int shape, int mode, int count, - DDXPointPtr pPts, BoxPtr box) -{ -} - /******************************************************************************/ void rdpFillPolygonOrg(DrawablePtr pDrawable, GCPtr pGC, @@ -62,33 +52,6 @@ rdpFillPolygonOrg(DrawablePtr pDrawable, GCPtr pGC, GC_OP_EPILOGUE(pGC); } -/******************************************************************************/ -void -rdpFillPolygonPost(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, - int shape, int mode, int count, - DDXPointPtr pPts, BoxPtr box) -{ - RegionRec reg; - - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) - { - return; - } - rdpRegionInit(®, box, 0); - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(®, clip_reg, ®); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, ®); - rdpRegionUninit(®); -} - /******************************************************************************/ void rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC, @@ -96,8 +59,8 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC, DDXPointPtr pPts) { rdpPtr dev; - rdpClientCon *clientCon; RegionRec clip_reg; + RegionRec reg; int cd; int maxx; int maxy; @@ -135,24 +98,20 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC, box.x2 = pDrawable->x + maxx + 1; box.y2 = pDrawable->y + maxy + 1; } + rdpRegionInit(®, &box, 0); rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); LLOGLN(10, ("rdpFillPolygon: cd %d", cd)); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd == XRDP_CD_CLIP) { - rdpFillPolygonPre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - shape, mode, count, pPts, &box); - clientCon = clientCon->next; + rdpRegionIntersect(®, &clip_reg, ®); } /* do original call */ rdpFillPolygonOrg(pDrawable, pGC, shape, mode, count, pPts); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd != XRDP_CD_NODRAW) { - rdpFillPolygonPost(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - shape, mode, count, pPts, &box); - clientCon = clientCon->next; + rdpClientConAddAllReg(dev, ®, pDrawable); } rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); } diff --git a/xorg/server/module/rdpGlyphs.c b/xorg/server/module/rdpGlyphs.c index a4e93e47..e6fcbb30 100644 --- a/xorg/server/module/rdpGlyphs.c +++ b/xorg/server/module/rdpGlyphs.c @@ -96,7 +96,7 @@ rdpGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictureScreenPtr ps; LLOGLN(10, ("rdpGlyphs:")); - pScreen = pSrc->pDrawable->pScreen; + pScreen = pDst->pDrawable->pScreen; dev = rdpGetDevFromScreen(pScreen); ps = GetPictureScreen(pScreen); rdpGlyphsOrg(ps, dev, op, pSrc, pDst, maskFormat, xSrc, ySrc, diff --git a/xorg/server/module/rdpImageGlyphBlt.c b/xorg/server/module/rdpImageGlyphBlt.c index 5a5ceca2..74693fd9 100644 --- a/xorg/server/module/rdpImageGlyphBlt.c +++ b/xorg/server/module/rdpImageGlyphBlt.c @@ -39,17 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) -/******************************************************************************/ -static void -rdpImageGlyphBltPre(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, - int x, int y, unsigned int nglyph, - CharInfoPtr *ppci, pointer pglyphBase, - BoxPtr box) -{ -} - /******************************************************************************/ static void rdpImageGlyphBltOrg(DrawablePtr pDrawable, GCPtr pGC, @@ -63,34 +52,6 @@ rdpImageGlyphBltOrg(DrawablePtr pDrawable, GCPtr pGC, GC_OP_EPILOGUE(pGC); } -/******************************************************************************/ -static void -rdpImageGlyphBltPost(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, - int x, int y, unsigned int nglyph, - CharInfoPtr *ppci, pointer pglyphBase, - BoxPtr box) -{ - RegionRec reg; - - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) - { - return; - } - rdpRegionInit(®, box, 0); - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(®, clip_reg, ®); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, ®); - rdpRegionUninit(®); -} - /******************************************************************************/ void rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, @@ -98,8 +59,8 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, CharInfoPtr *ppci, pointer pglyphBase) { rdpPtr dev; - rdpClientCon *clientCon; RegionRec clip_reg; + RegionRec reg; int cd; BoxRec box; @@ -107,24 +68,20 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, dev = rdpGetDevFromScreen(pGC->pScreen); dev->counts.rdpImageGlyphBltCallCount++; GetTextBoundingBox(pDrawable, pGC->font, x, y, nglyph, &box); + rdpRegionInit(®, &box, 0); rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); LLOGLN(10, ("rdpImageGlyphBlt: cd %d", cd)); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd == XRDP_CD_CLIP) { - rdpImageGlyphBltPre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - x, y, nglyph, ppci, pglyphBase, &box); - clientCon = clientCon->next; + rdpRegionIntersect(®, &clip_reg, ®); } /* do original call */ rdpImageGlyphBltOrg(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd != XRDP_CD_NODRAW) { - rdpImageGlyphBltPost(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - x, y, nglyph, ppci, pglyphBase, &box); - clientCon = clientCon->next; + rdpClientConAddAllReg(dev, ®, pDrawable); } rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); } diff --git a/xorg/server/module/rdpImageText16.c b/xorg/server/module/rdpImageText16.c index 43d8f184..7ad8012b 100644 --- a/xorg/server/module/rdpImageText16.c +++ b/xorg/server/module/rdpImageText16.c @@ -39,16 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) -/******************************************************************************/ -static void -rdpImageText16Pre(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, - int x, int y, int count, unsigned short *chars, - BoxPtr box) -{ -} - /******************************************************************************/ static void rdpImageText16Org(DrawablePtr pDrawable, GCPtr pGC, @@ -61,41 +51,14 @@ rdpImageText16Org(DrawablePtr pDrawable, GCPtr pGC, GC_OP_EPILOGUE(pGC); } -/******************************************************************************/ -static void -rdpImageText16Post(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, - int x, int y, int count, unsigned short *chars, - BoxPtr box) -{ - RegionRec reg; - - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) - { - return; - } - rdpRegionInit(®, box, 0); - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(®, clip_reg, ®); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, ®); - rdpRegionUninit(®); -} - /******************************************************************************/ void rdpImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *chars) { rdpPtr dev; - rdpClientCon *clientCon; RegionRec clip_reg; + RegionRec reg; int cd; BoxRec box; @@ -103,24 +66,20 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC, dev = rdpGetDevFromScreen(pGC->pScreen); dev->counts.rdpImageText16CallCount++; GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); + rdpRegionInit(®, &box, 0); rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); LLOGLN(10, ("rdpImageText16: cd %d", cd)); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd == XRDP_CD_CLIP) { - rdpImageText16Pre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - x, y, count, chars, &box); - clientCon = clientCon->next; + rdpRegionIntersect(®, &clip_reg, ®); } /* do original call */ rdpImageText16Org(pDrawable, pGC, x, y, count, chars); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd != XRDP_CD_NODRAW) { - rdpImageText16Post(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - x, y, count, chars, &box); - clientCon = clientCon->next; + rdpClientConAddAllReg(dev, ®, pDrawable); } rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); } diff --git a/xorg/server/module/rdpImageText8.c b/xorg/server/module/rdpImageText8.c index 3b48cfa4..abcfbff0 100644 --- a/xorg/server/module/rdpImageText8.c +++ b/xorg/server/module/rdpImageText8.c @@ -39,16 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) -/******************************************************************************/ -static void -rdpImageText8Pre(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, - int x, int y, int count, char *chars, - BoxPtr box) -{ -} - /******************************************************************************/ static void rdpImageText8Org(DrawablePtr pDrawable, GCPtr pGC, @@ -61,41 +51,14 @@ rdpImageText8Org(DrawablePtr pDrawable, GCPtr pGC, GC_OP_EPILOGUE(pGC); } -/******************************************************************************/ -static void -rdpImageText8Post(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, - int x, int y, int count, char *chars, - BoxPtr box) -{ - RegionRec reg; - - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) - { - return; - } - rdpRegionInit(®, box, 0); - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(®, clip_reg, ®); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, ®); - rdpRegionUninit(®); -} - /******************************************************************************/ void rdpImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *chars) { rdpPtr dev; - rdpClientCon *clientCon; RegionRec clip_reg; + RegionRec reg; int cd; BoxRec box; @@ -103,24 +66,20 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC, dev = rdpGetDevFromScreen(pGC->pScreen); dev->counts.rdpImageText8CallCount++; GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); + rdpRegionInit(®, &box, 0); rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); LLOGLN(10, ("rdpImageText8: cd %d", cd)); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd == XRDP_CD_CLIP) { - rdpImageText8Pre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - x, y, count, chars, &box); - clientCon = clientCon->next; + rdpRegionIntersect(®, &clip_reg, ®); } /* do original call */ rdpImageText8Org(pDrawable, pGC, x, y, count, chars); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd != XRDP_CD_NODRAW) { - rdpImageText8Post(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - x, y, count, chars, &box); - clientCon = clientCon->next; + rdpClientConAddAllReg(dev, ®, pDrawable); } rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); } diff --git a/xorg/server/module/rdpPixmap.h b/xorg/server/module/rdpPixmap.h index 0ab10a3f..7fce3186 100644 --- a/xorg/server/module/rdpPixmap.h +++ b/xorg/server/module/rdpPixmap.h @@ -24,13 +24,8 @@ pixmap calls #ifndef __RDPPIXMAP_H #define __RDPPIXAMP_H -#ifndef XORG_VERSION_NUMERIC -#warning XORG_VERSION_NUMERIC not defined, need #include -#endif - -#ifndef XORG_VERSION_CURRENT -#warning XORG_VERSION_CURRENT not defined -#endif +#include +#include #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 5, 0, 0, 0) /* 1.1, 1.2, 1.3, 1.4 */ diff --git a/xorg/server/module/rdpPolyArc.c b/xorg/server/module/rdpPolyArc.c index c3d6bef9..9a701dd8 100644 --- a/xorg/server/module/rdpPolyArc.c +++ b/xorg/server/module/rdpPolyArc.c @@ -39,15 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) -/******************************************************************************/ -static void -rdpPolyArcPre(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs, - RegionPtr reg) -{ -} - /******************************************************************************/ static void rdpPolyArcOrg(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) @@ -59,34 +50,11 @@ rdpPolyArcOrg(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) GC_OP_EPILOGUE(pGC); } -/******************************************************************************/ -static void -rdpPolyArcPost(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs, - RegionPtr reg) -{ - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) - { - return; - } - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(reg, clip_reg, reg); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, reg); -} - /******************************************************************************/ void rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) { rdpPtr dev; - rdpClientCon *clientCon; BoxRec box; int index; int cd; @@ -95,7 +63,7 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) RegionRec clip_reg; RegionRec reg; - LLOGLN(10, ("rdpPolyArc:")); + LLOGLN(0, ("rdpPolyArc:")); dev = rdpGetDevFromScreen(pGC->pScreen); dev->counts.rdpPolyArcCallCount++; rdpRegionInit(®, NullBox, 0); @@ -119,22 +87,16 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); LLOGLN(10, ("rdpPolyArc: cd %d", cd)); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd == XRDP_CD_CLIP) { - rdpPolyArcPre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - narcs, parcs, ®); - clientCon = clientCon->next; + rdpRegionIntersect(®, &clip_reg, ®); } /* do original call */ rdpPolyArcOrg(pDrawable, pGC, narcs, parcs); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd != XRDP_CD_NODRAW) { - rdpPolyArcPost(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - narcs, parcs, ®); - clientCon = clientCon->next; + rdpClientConAddAllReg(dev, ®, pDrawable); } - rdpRegionUninit(®); rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); } diff --git a/xorg/server/module/rdpPolyFillArc.c b/xorg/server/module/rdpPolyFillArc.c index 438ed7b7..437929ae 100644 --- a/xorg/server/module/rdpPolyFillArc.c +++ b/xorg/server/module/rdpPolyFillArc.c @@ -39,15 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) -/******************************************************************************/ -static void -rdpPolyFillArcPre(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs, - RegionPtr reg) -{ -} - /******************************************************************************/ static void rdpPolyFillArcOrg(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) @@ -59,34 +50,11 @@ rdpPolyFillArcOrg(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) GC_OP_EPILOGUE(pGC); } -/******************************************************************************/ -static void -rdpPolyFillArcPost(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs, - RegionPtr reg) -{ - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) - { - return; - } - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(reg, clip_reg, reg); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, reg); -} - /******************************************************************************/ void rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) { rdpPtr dev; - rdpClientCon *clientCon; BoxRec box; int index; int cd; @@ -95,7 +63,7 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) RegionRec clip_reg; RegionRec reg; - LLOGLN(0, ("rdpPolyFillArc:")); + LLOGLN(10, ("rdpPolyFillArc:")); dev = rdpGetDevFromScreen(pGC->pScreen); dev->counts.rdpPolyFillArcCallCount++; rdpRegionInit(®, NullBox, 0); @@ -119,23 +87,16 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); LLOGLN(10, ("rdpPolyFillArc: cd %d", cd)); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd == XRDP_CD_CLIP) { - rdpPolyFillArcPre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - narcs, parcs, ®); - clientCon = clientCon->next; + rdpRegionIntersect(®, &clip_reg, ®); } - /* do original call */ rdpPolyFillArcOrg(pDrawable, pGC, narcs, parcs); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd != XRDP_CD_NODRAW) { - rdpPolyFillArcPost(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - narcs, parcs, ®); - clientCon = clientCon->next; + rdpClientConAddAllReg(dev, ®, pDrawable); } - rdpRegionUninit(®); rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); } diff --git a/xorg/server/module/rdpPolyFillRect.c b/xorg/server/module/rdpPolyFillRect.c index e052d508..f61202b2 100644 --- a/xorg/server/module/rdpPolyFillRect.c +++ b/xorg/server/module/rdpPolyFillRect.c @@ -39,16 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) -/******************************************************************************/ -static void -rdpPolyFillRectPre(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, - int nrectFill, xRectangle *prectInit, - RegionPtr reg) -{ -} - /******************************************************************************/ static void rdpPolyFillRectOrg(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, @@ -61,36 +51,12 @@ rdpPolyFillRectOrg(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, GC_OP_EPILOGUE(pGC); } -/******************************************************************************/ -static void -rdpPolyFillRectPost(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, - int nrectFill, xRectangle *prectInit, - RegionPtr reg) -{ - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) - { - return; - } - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(reg, clip_reg, reg); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, reg); -} - /******************************************************************************/ void rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *prectInit) { rdpPtr dev; - rdpClientCon *clientCon; RegionRec clip_reg; RegionPtr reg; int cd; @@ -104,21 +70,15 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); LLOGLN(10, ("rdpPolyFillRect: cd %d", cd)); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd == XRDP_CD_CLIP) { - rdpPolyFillRectPre(dev, clientCon, cd, &clip_reg, pDrawable, - pGC, nrectFill, prectInit, reg); - clientCon = clientCon->next; + rdpRegionIntersect(reg, &clip_reg, reg); } /* do original call */ rdpPolyFillRectOrg(pDrawable, pGC, nrectFill, prectInit); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd != XRDP_CD_NODRAW) { - rdpPolyFillRectPost(dev, clientCon, cd, &clip_reg, pDrawable, - pGC, nrectFill, prectInit, reg); - clientCon = clientCon->next; + rdpClientConAddAllReg(dev, reg, pDrawable); } rdpRegionUninit(&clip_reg); rdpRegionDestroy(reg); diff --git a/xorg/server/module/rdpPolyGlyphBlt.c b/xorg/server/module/rdpPolyGlyphBlt.c index 7801a15e..e43e676b 100644 --- a/xorg/server/module/rdpPolyGlyphBlt.c +++ b/xorg/server/module/rdpPolyGlyphBlt.c @@ -32,6 +32,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "rdp.h" #include "rdpDraw.h" +#include "rdpClientCon.h" +#include "rdpReg.h" #define LOG_LEVEL 1 #define LLOGLN(_level, _args) \ @@ -56,7 +58,30 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, pointer pglyphBase) { + rdpPtr dev; + RegionRec clip_reg; + RegionRec reg; + int cd; + BoxRec box; + LLOGLN(0, ("rdpPolyGlyphBlt:")); + dev = rdpGetDevFromScreen(pGC->pScreen); + dev->counts.rdpPolyGlyphBltCallCount++; + GetTextBoundingBox(pDrawable, pGC->font, x, y, nglyph, &box); + rdpRegionInit(®, &box, 0); + rdpRegionInit(&clip_reg, NullBox, 0); + cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); + LLOGLN(10, ("rdpPolyGlyphBlt: cd %d", cd)); + if (cd == XRDP_CD_CLIP) + { + rdpRegionIntersect(®, &clip_reg, ®); + } /* do original call */ rdpPolyGlyphBltOrg(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); + if (cd != XRDP_CD_NODRAW) + { + rdpClientConAddAllReg(dev, ®, pDrawable); + } + rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); } diff --git a/xorg/server/module/rdpPolyPoint.c b/xorg/server/module/rdpPolyPoint.c index dafeb9bb..5dfac5ef 100644 --- a/xorg/server/module/rdpPolyPoint.c +++ b/xorg/server/module/rdpPolyPoint.c @@ -39,15 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) -/******************************************************************************/ -static void -rdpPolyPointPre(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, int mode, - int npt, DDXPointPtr in_pts, RegionPtr reg) -{ -} - /******************************************************************************/ static void rdpPolyPointOrg(DrawablePtr pDrawable, GCPtr pGC, int mode, @@ -60,69 +51,43 @@ rdpPolyPointOrg(DrawablePtr pDrawable, GCPtr pGC, int mode, GC_OP_EPILOGUE(pGC); } -/******************************************************************************/ -static void -rdpPolyPointPost(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, int mode, - int npt, DDXPointPtr in_pts, RegionPtr reg) -{ - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) - { - return; - } - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(reg, clip_reg, reg); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, reg); -} - /******************************************************************************/ void rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr in_pts) { rdpPtr dev; - rdpClientCon *clientCon; RegionRec clip_reg; RegionRec reg; int cd; + int index; + BoxRec box; - LLOGLN(0, ("rdpPolyPoint:")); + LLOGLN(10, ("rdpPolyPoint:")); dev = rdpGetDevFromScreen(pGC->pScreen); dev->counts.rdpPolyPointCallCount++; - rdpRegionInit(®, NullBox, 0); - /* TODO */ - + for (index = 0; index < npt; index++) + { + box.x1 = in_pts[index].x + pDrawable->x; + box.y1 = in_pts[index].y + pDrawable->y; + box.x2 = box.x1 + 1; + box.y2 = box.y1 + 1; + rdpRegionUnionRect(®, &box); + } rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); LLOGLN(10, ("rdpPolyPoint: cd %d", cd)); - - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd == XRDP_CD_CLIP) { - rdpPolyPointPre(dev, clientCon, cd, &clip_reg, pDrawable, - pGC, mode, npt, in_pts, ®); - clientCon = clientCon->next; + rdpRegionIntersect(®, &clip_reg, ®); } - /* do original call */ rdpPolyPointOrg(pDrawable, pGC, mode, npt, in_pts); - - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd != XRDP_CD_NODRAW) { - rdpPolyPointPost(dev, clientCon, cd, &clip_reg, pDrawable, - pGC, mode, npt, in_pts, ®); - clientCon = clientCon->next; + rdpClientConAddAllReg(dev, ®, pDrawable); } - rdpRegionUninit(&clip_reg); rdpRegionUninit(®); } diff --git a/xorg/server/module/rdpPolyRectangle.c b/xorg/server/module/rdpPolyRectangle.c index 304a8122..18311907 100644 --- a/xorg/server/module/rdpPolyRectangle.c +++ b/xorg/server/module/rdpPolyRectangle.c @@ -39,15 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) -/******************************************************************************/ -void -rdpPolyRectanglePre(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, int nrects, - xRectangle *rects, RegionPtr reg) -{ -} - /******************************************************************************/ static void rdpPolyRectangleOrg(DrawablePtr pDrawable, GCPtr pGC, int nrects, @@ -60,41 +51,22 @@ rdpPolyRectangleOrg(DrawablePtr pDrawable, GCPtr pGC, int nrects, GC_OP_EPILOGUE(pGC); } -/******************************************************************************/ -void -rdpPolyRectanglePost(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, int nrects, - xRectangle *rects, RegionPtr reg) -{ - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) - { - return; - } - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(reg, clip_reg, reg); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, reg); -} - /******************************************************************************/ void rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects, xRectangle *rects) { rdpPtr dev; - rdpClientCon *clientCon; BoxRec box; int index; int up; int down; int lw; int cd; + int x1; + int y1; + int x2; + int y2; RegionRec clip_reg; RegionRec reg; @@ -112,54 +84,49 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects, index = 0; while (index < nrects) { - - box.x1 = (rects[index].x + pDrawable->x) - up; - box.y1 = (rects[index].y + pDrawable->y) - up; - box.x2 = box.x1 + rects[index].width + (up + down); - box.y2 = box.y1 + lw; + x1 = rects[index].x + pDrawable->x; + y1 = rects[index].y + pDrawable->y; + x2 = x1 + rects[index].width; + y2 = y1 + rects[index].height; + /* top */ + box.x1 = x1 - up; + box.y1 = y1 - up; + box.x2 = x2 + down; + box.y2 = y1 + down; rdpRegionUnionRect(®, &box); - - box.x1 = (rects[index].x + pDrawable->x) - up; - box.y1 = (rects[index].y + pDrawable->y) + down; - box.x2 = box.x1 + lw; - box.y2 = box.y1 + rects[index].height - (up + down); + /* left */ + box.x1 = x1 - up; + box.y1 = y1 - up; + box.x2 = x1 + down; + box.y2 = y2 + down; rdpRegionUnionRect(®, &box); - - box.x1 = ((rects[index].x + rects[index].width) + pDrawable->x) - up; - box.y1 = (rects[index].y + pDrawable->y) + down; - box.x2 = box.x1 + lw; - box.y2 = box.y1 + rects[index].height - (up + down); + /* right */ + box.x1 = x2 - up; + box.y1 = y1 - up; + box.x2 = x2 + down; + box.y2 = y2 + down; rdpRegionUnionRect(®, &box); - - box.x1 = (rects[index].x + pDrawable->x) - up; - box.y1 = ((rects[index].y + rects[index].height) + pDrawable->y) - up; - box.x2 = box.x1 + rects[index].width + (up + down); - box.y2 = box.y1 + lw; + /* bottom */ + box.x1 = x1 - up; + box.y1 = y2 - up; + box.x2 = x2 + down; + box.y2 = y2 + down; rdpRegionUnionRect(®, &box); - index++; } - rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); LLOGLN(10, ("rdpPolyRectangle: cd %d", cd)); - - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd == XRDP_CD_CLIP) { - rdpPolyRectanglePre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - nrects, rects, ®); - clientCon = clientCon->next; + rdpRegionIntersect(®, &clip_reg, ®); } /* do original call */ rdpPolyRectangleOrg(pDrawable, pGC, nrects, rects); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd != XRDP_CD_NODRAW) { - rdpPolyRectanglePost(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - nrects, rects, ®); - clientCon = clientCon->next; + rdpClientConAddAllReg(dev, ®, pDrawable); } - rdpRegionUninit(®); rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); } diff --git a/xorg/server/module/rdpPolySegment.c b/xorg/server/module/rdpPolySegment.c index 00ac0ac2..98e4eb1f 100644 --- a/xorg/server/module/rdpPolySegment.c +++ b/xorg/server/module/rdpPolySegment.c @@ -32,6 +32,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "rdp.h" #include "rdpDraw.h" +#include "rdpClientCon.h" +#include "rdpReg.h" #define LOG_LEVEL 1 #define LLOGLN(_level, _args) \ @@ -52,7 +54,46 @@ rdpPolySegmentOrg(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs) void rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs) { - LLOGLN(0, ("rdpPolySegment:")); + rdpPtr dev; + RegionRec clip_reg; + RegionRec reg; + int cd; + int index; + int x1; + int y1; + int x2; + int y2; + BoxRec box; + + LLOGLN(10, ("rdpPolySegment:")); + dev = rdpGetDevFromScreen(pGC->pScreen); + dev->counts.rdpPolySegmentCallCount++; + rdpRegionInit(®, NullBox, 0); + for (index = 0; index < nseg; index++) + { + x1 = pSegs[index].x1 + pDrawable->x; + y1 = pSegs[index].y1 + pDrawable->y; + x2 = pSegs[index].x2 + pDrawable->x; + y2 = pSegs[index].y2 + pDrawable->y; + box.x1 = RDPMIN(x1, x2); + box.y1 = RDPMIN(y1, y2); + box.x2 = RDPMAX(x1, x2) + 1; + box.y2 = RDPMAX(y1, y2) + 1; + rdpRegionUnionRect(®, &box); + } + rdpRegionInit(&clip_reg, NullBox, 0); + cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); + LLOGLN(10, ("rdpPolySegment: cd %d", cd)); + if (cd == XRDP_CD_CLIP) + { + rdpRegionIntersect(®, &clip_reg, ®); + } /* do original call */ rdpPolySegmentOrg(pDrawable, pGC, nseg, pSegs); + if (cd != XRDP_CD_NODRAW) + { + rdpClientConAddAllReg(dev, ®, pDrawable); + } + rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); } diff --git a/xorg/server/module/rdpPolyText16.c b/xorg/server/module/rdpPolyText16.c index 4284a3dd..90d68a8c 100644 --- a/xorg/server/module/rdpPolyText16.c +++ b/xorg/server/module/rdpPolyText16.c @@ -39,16 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) -/******************************************************************************/ -static void -rdpPolyText16Pre(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, - int x, int y, int count, unsigned short *chars, - BoxPtr box) -{ -} - /******************************************************************************/ static int rdpPolyText16Org(DrawablePtr pDrawable, GCPtr pGC, @@ -63,33 +53,6 @@ rdpPolyText16Org(DrawablePtr pDrawable, GCPtr pGC, return rv; } -/******************************************************************************/ -static void -rdpPolyText16Post(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, - int x, int y, int count, unsigned short *chars, - BoxPtr box) -{ - RegionRec reg; - - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) - { - return; - } - rdpRegionInit(®, box, 0); - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(®, clip_reg, ®); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, ®); - rdpRegionUninit(®); -} - /******************************************************************************/ int rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC, @@ -97,8 +60,8 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC, { int rv; rdpPtr dev; - rdpClientCon *clientCon; RegionRec clip_reg; + RegionRec reg; int cd; BoxRec box; @@ -106,25 +69,21 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC, dev = rdpGetDevFromScreen(pGC->pScreen); dev->counts.rdpPolyText16CallCount++; GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); + rdpRegionInit(®, &box, 0); rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); LLOGLN(10, ("rdpPolyText16: cd %d", cd)); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd == XRDP_CD_CLIP) { - rdpPolyText16Pre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - x, y, count, chars, &box); - clientCon = clientCon->next; + rdpRegionIntersect(®, &clip_reg, ®); } /* do original call */ rv = rdpPolyText16Org(pDrawable, pGC, x, y, count, chars); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd != XRDP_CD_NODRAW) { - rdpPolyText16Post(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - x, y, count, chars, &box); - clientCon = clientCon->next; + rdpClientConAddAllReg(dev, ®, pDrawable); } rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); return rv; } diff --git a/xorg/server/module/rdpPolyText8.c b/xorg/server/module/rdpPolyText8.c index 52873a65..630bc04e 100644 --- a/xorg/server/module/rdpPolyText8.c +++ b/xorg/server/module/rdpPolyText8.c @@ -39,16 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) -/******************************************************************************/ -static void -rdpPolyText8Pre(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, - int x, int y, int count, char *chars, - BoxPtr box) -{ -} - /******************************************************************************/ static int rdpPolyText8Org(DrawablePtr pDrawable, GCPtr pGC, @@ -63,33 +53,6 @@ rdpPolyText8Org(DrawablePtr pDrawable, GCPtr pGC, return rv; } -/******************************************************************************/ -static void -rdpPolyText8Post(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, - int x, int y, int count, char *chars, - BoxPtr box) -{ - RegionRec reg; - - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) - { - return; - } - rdpRegionInit(®, box, 0); - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(®, clip_reg, ®); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, ®); - rdpRegionUninit(®); -} - /******************************************************************************/ int rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC, @@ -97,8 +60,8 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC, { int rv; rdpPtr dev; - rdpClientCon *clientCon; RegionRec clip_reg; + RegionRec reg; int cd; BoxRec box; @@ -106,25 +69,21 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC, dev = rdpGetDevFromScreen(pGC->pScreen); dev->counts.rdpPolyText8CallCount++; GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); + rdpRegionInit(®, &box, 0); rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); LLOGLN(10, ("rdpPolyText8: cd %d", cd)); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd == XRDP_CD_CLIP) { - rdpPolyText8Pre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - x, y, count, chars, &box); - clientCon = clientCon->next; + rdpRegionIntersect(®, &clip_reg, ®); } /* do original call */ rv = rdpPolyText8Org(pDrawable, pGC, x, y, count, chars); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd != XRDP_CD_NODRAW) { - rdpPolyText8Post(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - x, y, count, chars, &box); - clientCon = clientCon->next; + rdpClientConAddAllReg(dev, ®, pDrawable); } rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); return rv; } diff --git a/xorg/server/module/rdpPolylines.c b/xorg/server/module/rdpPolylines.c index ee7a6008..da979e9f 100644 --- a/xorg/server/module/rdpPolylines.c +++ b/xorg/server/module/rdpPolylines.c @@ -32,6 +32,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "rdp.h" #include "rdpDraw.h" +#include "rdpClientCon.h" +#include "rdpReg.h" #define LOG_LEVEL 1 #define LLOGLN(_level, _args) \ @@ -54,7 +56,46 @@ void rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr pptInit) { - LLOGLN(0, ("rdpPolylines:")); + rdpPtr dev; + RegionRec clip_reg; + RegionRec reg; + int cd; + int index; + int x1; + int y1; + int x2; + int y2; + BoxRec box; + + LLOGLN(10, ("rdpPolylines:")); + dev = rdpGetDevFromScreen(pGC->pScreen); + dev->counts.rdpPolylinesCallCount++; + rdpRegionInit(®, NullBox, 0); + for (index = 1; index < npt; index++) + { + x1 = pptInit[index - 1].x + pDrawable->x; + y1 = pptInit[index - 1].y + pDrawable->y; + x2 = pptInit[index].x + pDrawable->x; + y2 = pptInit[index].y + pDrawable->y; + box.x1 = RDPMIN(x1, x2); + box.y1 = RDPMIN(y1, y2); + box.x2 = RDPMAX(x1, x2) + 1; + box.y2 = RDPMAX(y1, y2) + 1; + rdpRegionUnionRect(®, &box); + } + rdpRegionInit(&clip_reg, NullBox, 0); + cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); + LLOGLN(10, ("rdpPolylines: cd %d", cd)); + if (cd == XRDP_CD_CLIP) + { + rdpRegionIntersect(®, &clip_reg, ®); + } /* do original call */ rdpPolylinesOrg(pDrawable, pGC, mode, npt, pptInit); + if (cd != XRDP_CD_NODRAW) + { + rdpClientConAddAllReg(dev, ®, pDrawable); + } + rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); } diff --git a/xorg/server/module/rdpPutImage.c b/xorg/server/module/rdpPutImage.c index f7af2882..b7134479 100644 --- a/xorg/server/module/rdpPutImage.c +++ b/xorg/server/module/rdpPutImage.c @@ -39,15 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define LLOGLN(_level, _args) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) -/******************************************************************************/ -void -rdpPutImagePre(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, - int w, int h, int leftPad, int format, char *pBits) -{ -} - /******************************************************************************/ static void rdpPutImageOrg(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, @@ -63,67 +54,36 @@ rdpPutImageOrg(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, /******************************************************************************/ void -rdpPutImagePost(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, - int w, int h, int leftPad, int format, char *pBits) +rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, + int w, int h, int leftPad, int format, char *pBits) { - BoxRec box; + rdpPtr dev; + RegionRec clip_reg; RegionRec reg; + int cd; + BoxRec box; - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDst)) - { - return; - } + LLOGLN(10, ("rdpPutImage:")); + dev = rdpGetDevFromScreen(pGC->pScreen); + dev->counts.rdpPutImageCallCount++; box.x1 = x + pDst->x; box.y1 = y + pDst->y; box.x2 = box.x1 + w; box.y2 = box.y1 + h; rdpRegionInit(®, &box, 0); - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(®, clip_reg, ®); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, ®); - rdpRegionUninit(®); -} - -/******************************************************************************/ -void -rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, - int w, int h, int leftPad, int format, char *pBits) -{ - rdpPtr dev; - rdpClientCon *clientCon; - RegionRec clip_reg; - int cd; - - LLOGLN(10, ("rdpPutImage:")); - dev = rdpGetDevFromScreen(pGC->pScreen); - dev->counts.rdpPutImageCallCount++; rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDst, pGC); LLOGLN(10, ("rdpPutImage: cd %d", cd)); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd == XRDP_CD_CLIP) { - rdpPutImagePre(dev, clientCon, cd, &clip_reg, pDst, pGC, depth, x, y, - w, h, leftPad, format, pBits); - clientCon = clientCon->next; + rdpRegionIntersect(®, &clip_reg, ®); } - /* do original call */ rdpPutImageOrg(pDst, pGC, depth, x, y, w, h, leftPad, format, pBits); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd != XRDP_CD_NODRAW) { - rdpPutImagePost(dev, clientCon, cd, &clip_reg, pDst, pGC, depth, x, y, - w, h, leftPad, format, pBits); - clientCon = clientCon->next; + rdpClientConAddAllReg(dev, ®, pDst); } rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); } diff --git a/xorg/server/module/rdpRandR.c b/xorg/server/module/rdpRandR.c index c90c0303..37577645 100644 --- a/xorg/server/module/rdpRandR.c +++ b/xorg/server/module/rdpRandR.c @@ -27,6 +27,7 @@ RandR draw calls /* this should be before all X11 .h files */ #include +#include /* all driver need this */ #include @@ -141,8 +142,13 @@ rdpRRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, RRGetInfo(pScreen, 1); LLOGLN(0, (" screen resized to %dx%d", pScreen->width, pScreen->height)); RRScreenSizeNotify(pScreen); +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0) xf86EnableDisableFBAccess(pScreen->myNum, FALSE); xf86EnableDisableFBAccess(pScreen->myNum, TRUE); +#else + xf86EnableDisableFBAccess(xf86Screens[pScreen->myNum], FALSE); + xf86EnableDisableFBAccess(xf86Screens[pScreen->myNum], TRUE); +#endif return TRUE; } diff --git a/xorg/server/module/rdpTrapezoids.c b/xorg/server/module/rdpTrapezoids.c new file mode 100644 index 00000000..05b34ec4 --- /dev/null +++ b/xorg/server/module/rdpTrapezoids.c @@ -0,0 +1,87 @@ +/* +Copyright 2014 Jay Sorg + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +#include +#include +#include + +/* this should be before all X11 .h files */ +#include + +/* all driver need this */ +#include +#include + +#include "mipict.h" +#include + +#include "rdp.h" +#include "rdpDraw.h" +#include "rdpClientCon.h" +#include "rdpReg.h" +#include "rdpTrapezoids.h" + +/******************************************************************************/ +#define LOG_LEVEL 1 +#define LLOGLN(_level, _args) \ + do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) + +/******************************************************************************/ +static void +rdpTrapezoidsOrg(PictureScreenPtr ps, rdpPtr dev, + CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int ntrap, xTrapezoid *traps) +{ + ps->Trapezoids = dev->Trapezoids; + ps->Trapezoids(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, traps); + ps->Trapezoids = rdpTrapezoids; +} + +/******************************************************************************/ +void +rdpTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int ntrap, xTrapezoid *traps) +{ + ScreenPtr pScreen; + rdpPtr dev; + PictureScreenPtr ps; + BoxRec box; + RegionRec reg; + + LLOGLN(10, ("rdpTrapezoids:")); + pScreen = pDst->pDrawable->pScreen; + dev = rdpGetDevFromScreen(pScreen); + dev->counts.rdpTrapezoidsCallCount++; + miTrapezoidBounds(ntrap, traps, &box); + box.x1 += pDst->pDrawable->x; + box.y1 += pDst->pDrawable->y; + box.x2 += pDst->pDrawable->x; + box.y2 += pDst->pDrawable->y; + rdpRegionInit(®, &box, 0); + ps = GetPictureScreen(pScreen); + /* do original call */ + rdpTrapezoidsOrg(ps, dev, op, pSrc, pDst, maskFormat, xSrc, ySrc, + ntrap, traps); + rdpClientConAddAllReg(dev, ®, pDst->pDrawable); + rdpRegionUninit(®); +} diff --git a/xorg/server/module/rdpTrapezoids.h b/xorg/server/module/rdpTrapezoids.h new file mode 100644 index 00000000..77738dc4 --- /dev/null +++ b/xorg/server/module/rdpTrapezoids.h @@ -0,0 +1,30 @@ +/* +Copyright 2014 Jay Sorg + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +#ifndef _RDPTRAPEZOIDS_H +#define _RDPTRAPEZOIDS_H + +void +rdpTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int ntrap, xTrapezoid *traps); + +#endif diff --git a/xorg/server/xrdpdev/xrdpdev.c b/xorg/server/xrdpdev/xrdpdev.c index 6c8f54d7..7e5959ba 100644 --- a/xorg/server/xrdpdev/xrdpdev.c +++ b/xorg/server/xrdpdev/xrdpdev.c @@ -47,6 +47,7 @@ This is the main driver file #include "rdpRandR.h" #include "rdpMisc.h" #include "rdpComposite.h" +#include "rdpTrapezoids.h" #include "rdpGlyphs.h" #include "rdpPixmap.h" #include "rdpClientCon.h" @@ -410,7 +411,11 @@ rdpWakeupHandler1(pointer blockData, int result, pointer pReadmask) /*****************************************************************************/ static Bool +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0) rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) +#else +rdpScreenInit(ScreenPtr pScreen, int argc, char **argv) +#endif { ScrnInfoPtr pScrn; rdpPtr dev; @@ -418,7 +423,7 @@ rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) Bool vis_found; PictureScreenPtr ps; - pScrn = xf86Screens[scrnIndex]; + pScrn = xf86Screens[pScreen->myNum]; dev = XRDPPTR(pScrn); dev->pScreen = pScreen; @@ -531,6 +536,9 @@ rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* glyphs */ dev->Glyphs = ps->Glyphs; ps->Glyphs = rdpGlyphs; + /* trapezoids */ + dev->Trapezoids = ps->Trapezoids; + ps->Trapezoids = rdpTrapezoids; } RegisterBlockAndWakeupHandlers(rdpBlockHandler1, rdpWakeupHandler1, pScreen); @@ -552,7 +560,11 @@ rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /*****************************************************************************/ static Bool +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0) rdpSwitchMode(int a, DisplayModePtr b, int c) +#else +rdpSwitchMode(ScrnInfoPtr a, DisplayModePtr b) +#endif { LLOGLN(0, ("rdpSwitchMode:")); return TRUE; @@ -560,14 +572,22 @@ rdpSwitchMode(int a, DisplayModePtr b, int c) /*****************************************************************************/ static void +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0) rdpAdjustFrame(int a, int b, int c, int d) +#else +rdpAdjustFrame(ScrnInfoPtr a, int b, int c) +#endif { LLOGLN(10, ("rdpAdjustFrame:")); } /*****************************************************************************/ static Bool +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0) rdpEnterVT(int a, int b) +#else +rdpEnterVT(ScrnInfoPtr a) +#endif { LLOGLN(0, ("rdpEnterVT:")); return TRUE; @@ -575,14 +595,22 @@ rdpEnterVT(int a, int b) /*****************************************************************************/ static void +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0) rdpLeaveVT(int a, int b) +#else +rdpLeaveVT(ScrnInfoPtr a) +#endif { LLOGLN(0, ("rdpLeaveVT:")); } /*****************************************************************************/ static ModeStatus +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0) rdpValidMode(int a, DisplayModePtr b, Bool c, int d) +#else +rdpValidMode(ScrnInfoPtr a, DisplayModePtr b, Bool c, int d) +#endif { LLOGLN(0, ("rdpValidMode:")); return 0; diff --git a/xup/xup.c b/xup/xup.c index 7ff5e5e8..d3079b91 100644 --- a/xup/xup.c +++ b/xup/xup.c @@ -21,9 +21,6 @@ #include "xup.h" #include "log.h" -#include -#include - #define LOG_LEVEL 1 #define LLOG(_level, _args) \ do { if (_level < LOG_LEVEL) { g_write _args ; } } while (0) @@ -527,7 +524,7 @@ process_server_window_show(struct mod* mod, struct stream* s) int rv; int flags; struct rail_window_state_order rwso; - + g_memset(&rwso, 0, sizeof(rwso)); in_uint32_le(s, window_id); in_uint32_le(s, flags); @@ -899,7 +896,7 @@ lib_mod_process_orders(struct mod *mod, int type, struct stream *s) if (mod->screen_shmem_id == 0) { mod->screen_shmem_id = shmem_id; - mod->screen_shmem_pixels = shmat(mod->screen_shmem_id, 0, 0); + mod->screen_shmem_pixels = g_shmat(mod->screen_shmem_id); } if (mod->screen_shmem_pixels != 0) { @@ -1062,6 +1059,11 @@ lib_mod_signal(struct mod *mod) int DEFAULT_CC lib_mod_end(struct mod *mod) { + if (mod->screen_shmem_pixels != 0) + { + g_shmdt(mod->screen_shmem_pixels); + mod->screen_shmem_pixels = 0; + } return 0; }