From 03e5b5e62bae5f872874869e62cc096c576fba16 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sat, 25 Jan 2014 11:30:45 -0800 Subject: [PATCH 1/8] xorg: work on xorg driver --- xorg/server/module/rdp.h | 4 +- xorg/server/module/rdpComposite.c | 97 +++++++++++++++++++++++++++- xorg/server/module/rdpComposite.h | 4 ++ xorg/server/module/rdpCopyArea.c | 36 ++++++----- xorg/server/module/rdpGlyphs.c | 2 +- xorg/server/module/rdpPolyArc.c | 10 +-- xorg/server/module/rdpPolyFillRect.c | 8 +-- xorg/server/module/rdpPolyPoint.c | 25 ++++--- xorg/server/module/rdpPolySegment.c | 87 ++++++++++++++++++++++++- xorg/server/module/rdpPolylines.c | 85 +++++++++++++++++++++++- xorg/server/xrdpdev/xrdpdev.c | 3 + 11 files changed, 320 insertions(+), 41 deletions(-) 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/rdpComposite.c b/xorg/server/module/rdpComposite.c index 9b5125d4..af922598 100644 --- a/xorg/server/module/rdpComposite.c +++ b/xorg/server/module/rdpComposite.c @@ -105,8 +105,8 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, PictureScreenPtr ps; BoxRec box; - LLOGLN(10, ("rdpComposite:")); - pScreen = pSrc->pDrawable->pScreen; + LLOGLN(0, ("rdpComposite:")); + pScreen = pDst->pDrawable->pScreen; dev = rdpGetDevFromScreen(pScreen); dev->counts.rdpCompositeCallCount++; box.x1 = xDst + pDst->pDrawable->x; @@ -134,3 +134,96 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, clientCon = clientCon->next; } } + +/******************************************************************************/ +static void +rdpTrapezoidsPre(rdpPtr dev, rdpClientCon *clientCon, PictureScreenPtr ps, + CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int ntrap, xTrapezoid *traps, BoxPtr box) +{ +} + +/******************************************************************************/ +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; +} + +/******************************************************************************/ +static void +rdpTrapezoidsPost(rdpPtr dev, rdpClientCon *clientCon, PictureScreenPtr ps, + CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int ntrap, xTrapezoid *traps, 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 +rdpTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int ntrap, xTrapezoid *traps) +{ + ScreenPtr pScreen; + rdpPtr dev; + rdpClientCon *clientCon; + PictureScreenPtr ps; + BoxRec box; + RegionRec reg; + int index; + + LLOGLN(0, ("rdpTrapezoids:")); + pScreen = pDst->pDrawable->pScreen; + dev = rdpGetDevFromScreen(pScreen); + dev->counts.rdpTrapezoidsCallCount++; + + rdpRegionInit(®, NullBox, 0); + for (index = 0; index < ntrap; index++) + { + LLOGLN(0, (" top %d bottom %d left p1 %d %d", + traps[index].top, traps[index].bottom, + traps[index].left.p1.x, traps[index].left.p1.y)); + //box.x1 = traps[index].left + pDst->pDrawable->x; + //box.y1 = traps[index].top + pDst->pDrawable->y; + //box.x2 = traps[index].right + pDst->pDrawable->x; + //box.y2 = traps[index].bottom + pDst->pDrawable->y; + } + ps = GetPictureScreen(pScreen); + clientCon = dev->clientConHead; + while (clientCon != NULL) + { + //rdpTrapezoidsPre(dev, clientCon, ps, op, pSrc, pDst, + // maskFormat, xSrc, ySrc, ntrap, traps, &box); + clientCon = clientCon->next; + } + /* do original call */ + rdpTrapezoidsOrg(ps, dev, op, pSrc, pDst, maskFormat, xSrc, ySrc, + ntrap, traps); + clientCon = dev->clientConHead; + while (clientCon != NULL) + { + //rdpTrapezoidsPost(dev, clientCon, ps, op, pSrc, pDst, + // maskFormat, xSrc, ySrc, ntrap, traps, &box); + clientCon = clientCon->next; + } +} diff --git a/xorg/server/module/rdpComposite.h b/xorg/server/module/rdpComposite.h index 017cb41d..9b922e9d 100644 --- a/xorg/server/module/rdpComposite.h +++ b/xorg/server/module/rdpComposite.h @@ -28,5 +28,9 @@ void rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height); +void +rdpTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int ntrap, xTrapezoid *traps); #endif diff --git a/xorg/server/module/rdpCopyArea.c b/xorg/server/module/rdpCopyArea.c index 7257fc3a..48a54b99 100644 --- a/xorg/server/module/rdpCopyArea.c +++ b/xorg/server/module/rdpCopyArea.c @@ -44,7 +44,8 @@ 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) + int srcx, int srcy, int w, int h, int dstx, int dsty, + RegionPtr reg) { } @@ -67,10 +68,9 @@ 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) + int srcx, int srcy, int w, int h, int dstx, int dsty, + RegionPtr reg) { - BoxRec box; - RegionRec reg; if (cd == XRDP_CD_NODRAW) { @@ -80,17 +80,7 @@ rdpCopyAreaPost(rdpPtr dev, rdpClientCon *clientCon, { 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(®); + rdpClientConAddDirtyScreenReg(dev, clientCon, reg); } /******************************************************************************/ @@ -103,6 +93,8 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, RegionPtr rv; RegionRec clip_reg; int cd; + BoxRec box; + RegionRec reg; LLOGLN(10, ("rdpCopyArea:")); dev = rdpGetDevFromScreen(pGC->pScreen); @@ -110,11 +102,20 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDst, pGC); LLOGLN(10, ("rdpCopyArea: cd %d", cd)); + 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, ®); + } clientCon = dev->clientConHead; while (clientCon != NULL) { rdpCopyAreaPre(dev, clientCon, cd, &clip_reg, pSrc, pDst, pGC, - srcx, srcy, w, h, dstx, dsty); + srcx, srcy, w, h, dstx, dsty, ®); clientCon = clientCon->next; } /* do original call */ @@ -123,9 +124,10 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, while (clientCon != NULL) { rdpCopyAreaPost(dev, clientCon, cd, &clip_reg, pSrc, pDst, pGC, - srcx, srcy, w, h, dstx, dsty); + srcx, srcy, w, h, dstx, dsty, ®); clientCon = clientCon->next; } rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); return rv; } 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/rdpPolyArc.c b/xorg/server/module/rdpPolyArc.c index c3d6bef9..e0a3d128 100644 --- a/xorg/server/module/rdpPolyArc.c +++ b/xorg/server/module/rdpPolyArc.c @@ -74,10 +74,6 @@ rdpPolyArcPost(rdpPtr dev, rdpClientCon *clientCon, { return; } - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(reg, clip_reg, reg); - } rdpClientConAddDirtyScreenReg(dev, clientCon, reg); } @@ -95,7 +91,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,6 +115,10 @@ 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)); + if (cd == XRDP_CD_CLIP) + { + rdpRegionIntersect(®, &clip_reg, ®); + } clientCon = dev->clientConHead; while (clientCon != NULL) { diff --git a/xorg/server/module/rdpPolyFillRect.c b/xorg/server/module/rdpPolyFillRect.c index e052d508..a3162d31 100644 --- a/xorg/server/module/rdpPolyFillRect.c +++ b/xorg/server/module/rdpPolyFillRect.c @@ -77,10 +77,6 @@ rdpPolyFillRectPost(rdpPtr dev, rdpClientCon *clientCon, { return; } - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(reg, clip_reg, reg); - } rdpClientConAddDirtyScreenReg(dev, clientCon, reg); } @@ -103,6 +99,10 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, rdpRegionTranslate(reg, pDrawable->x, pDrawable->y); rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); + if (cd == XRDP_CD_CLIP) + { + rdpRegionIntersect(reg, &clip_reg, reg); + } LLOGLN(10, ("rdpPolyFillRect: cd %d", cd)); clientCon = dev->clientConHead; while (clientCon != NULL) diff --git a/xorg/server/module/rdpPolyPoint.c b/xorg/server/module/rdpPolyPoint.c index dafeb9bb..df151b84 100644 --- a/xorg/server/module/rdpPolyPoint.c +++ b/xorg/server/module/rdpPolyPoint.c @@ -67,6 +67,8 @@ rdpPolyPointPost(rdpPtr dev, rdpClientCon *clientCon, DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr in_pts, RegionPtr reg) { + RegionRec lreg; + if (cd == XRDP_CD_NODRAW) { return; @@ -75,11 +77,13 @@ rdpPolyPointPost(rdpPtr dev, rdpClientCon *clientCon, { return; } + rdpRegionInit(&lreg, NullBox, 0); if (cd == XRDP_CD_CLIP) { - rdpRegionIntersect(reg, clip_reg, reg); + rdpRegionIntersect(&lreg, clip_reg, reg); } - rdpClientConAddDirtyScreenReg(dev, clientCon, reg); + rdpClientConAddDirtyScreenReg(dev, clientCon, &lreg); + rdpRegionUninit(&lreg); } /******************************************************************************/ @@ -92,18 +96,24 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, RegionRec clip_reg; RegionRec reg; int cd; + int index; + BoxRec box; LLOGLN(0, ("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) { @@ -111,10 +121,8 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, pGC, mode, npt, in_pts, ®); clientCon = clientCon->next; } - /* do original call */ rdpPolyPointOrg(pDrawable, pGC, mode, npt, in_pts); - clientCon = dev->clientConHead; while (clientCon != NULL) { @@ -122,7 +130,6 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, pGC, mode, npt, in_pts, ®); clientCon = clientCon->next; } - rdpRegionUninit(&clip_reg); rdpRegionUninit(®); } diff --git a/xorg/server/module/rdpPolySegment.c b/xorg/server/module/rdpPolySegment.c index 00ac0ac2..d242f736 100644 --- a/xorg/server/module/rdpPolySegment.c +++ b/xorg/server/module/rdpPolySegment.c @@ -32,11 +32,22 @@ 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) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) +/******************************************************************************/ +void +rdpPolySegmentPre(rdpPtr dev, rdpClientCon *clientCon, + int cd, RegionPtr clip_reg, + DrawablePtr pDrawable, GCPtr pGC, int nseg, + xSegment *pSegs, RegionPtr reg) +{ +} + /******************************************************************************/ void rdpPolySegmentOrg(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs) @@ -48,11 +59,85 @@ rdpPolySegmentOrg(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs) GC_OP_EPILOGUE(pGC); } +/******************************************************************************/ +void +rdpPolySegmentPost(rdpPtr dev, rdpClientCon *clientCon, + int cd, RegionPtr clip_reg, + DrawablePtr pDrawable, GCPtr pGC, int nseg, + xSegment *pSegs, RegionPtr reg) +{ + RegionRec lreg; + + if (cd == XRDP_CD_NODRAW) + { + return; + } + if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) + { + return; + } + rdpRegionInit(&lreg, NullBox, 0); + if (cd == XRDP_CD_CLIP) + { + rdpRegionIntersect(&lreg, clip_reg, reg); + } + rdpClientConAddDirtyScreenReg(dev, clientCon, &lreg); + rdpRegionUninit(&lreg); +} + /******************************************************************************/ void rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs) { - LLOGLN(0, ("rdpPolySegment:")); + rdpPtr dev; + rdpClientCon *clientCon; + 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)); + clientCon = dev->clientConHead; + while (clientCon != NULL) + { + rdpPolySegmentPre(dev, clientCon, cd, &clip_reg, pDrawable, + pGC, nseg, pSegs, ®); + clientCon = clientCon->next; + } /* do original call */ rdpPolySegmentOrg(pDrawable, pGC, nseg, pSegs); + + clientCon = dev->clientConHead; + while (clientCon != NULL) + { + rdpPolySegmentPost(dev, clientCon, cd, &clip_reg, pDrawable, + pGC, nseg, pSegs, ®); + clientCon = clientCon->next; + } + rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); + } diff --git a/xorg/server/module/rdpPolylines.c b/xorg/server/module/rdpPolylines.c index ee7a6008..630f2827 100644 --- a/xorg/server/module/rdpPolylines.c +++ b/xorg/server/module/rdpPolylines.c @@ -32,11 +32,22 @@ 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) \ do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) +/******************************************************************************/ +void +rdpPolylinesPre(rdpPtr dev, rdpClientCon *clientCon, + int cd, RegionPtr clip_reg, + DrawablePtr pDrawable, GCPtr pGC, int mode, + int npt, DDXPointPtr pptInit, RegionPtr reg) +{ +} + /******************************************************************************/ static void rdpPolylinesOrg(DrawablePtr pDrawable, GCPtr pGC, int mode, @@ -49,12 +60,84 @@ rdpPolylinesOrg(DrawablePtr pDrawable, GCPtr pGC, int mode, GC_OP_EPILOGUE(pGC); } +/******************************************************************************/ +void +rdpPolylinesPost(rdpPtr dev, rdpClientCon *clientCon, + int cd, RegionPtr clip_reg, + DrawablePtr pDrawable, GCPtr pGC, int mode, + int npt, DDXPointPtr pptInit, RegionPtr reg) +{ + RegionRec lreg; + + if (cd == XRDP_CD_NODRAW) + { + return; + } + if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) + { + return; + } + rdpRegionInit(&lreg, NullBox, 0); + if (cd == XRDP_CD_CLIP) + { + rdpRegionIntersect(&lreg, clip_reg, reg); + } + rdpClientConAddDirtyScreenReg(dev, clientCon, &lreg); + rdpRegionUninit(&lreg); +} + /******************************************************************************/ void rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr pptInit) { - LLOGLN(0, ("rdpPolylines:")); + rdpPtr dev; + rdpClientCon *clientCon; + 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)); + clientCon = dev->clientConHead; + while (clientCon != NULL) + { + rdpPolylinesPre(dev, clientCon, cd, &clip_reg, pDrawable, + pGC, mode, npt, pptInit, ®); + clientCon = clientCon->next; + } /* do original call */ rdpPolylinesOrg(pDrawable, pGC, mode, npt, pptInit); + clientCon = dev->clientConHead; + while (clientCon != NULL) + { + rdpPolylinesPost(dev, clientCon, cd, &clip_reg, pDrawable, + pGC, mode, npt, pptInit, ®); + clientCon = clientCon->next; + } + rdpRegionUninit(&clip_reg); + rdpRegionUninit(®); } diff --git a/xorg/server/xrdpdev/xrdpdev.c b/xorg/server/xrdpdev/xrdpdev.c index 6c8f54d7..1afcdb0f 100644 --- a/xorg/server/xrdpdev/xrdpdev.c +++ b/xorg/server/xrdpdev/xrdpdev.c @@ -531,6 +531,9 @@ rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* glyphs */ dev->Glyphs = ps->Glyphs; ps->Glyphs = rdpGlyphs; + + dev->Trapezoids = ps->Trapezoids; + ps->Trapezoids = rdpTrapezoids; } RegisterBlockAndWakeupHandlers(rdpBlockHandler1, rdpWakeupHandler1, pScreen); From 9d7e58ee98ccdab90b1096542c325b2f8bb930f1 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sat, 25 Jan 2014 09:29:32 -0800 Subject: [PATCH 2/8] xorg: work on xorg driver --- xorg/server/module/rdpPolyRectangle.c | 45 +++++++++++++++++---------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/xorg/server/module/rdpPolyRectangle.c b/xorg/server/module/rdpPolyRectangle.c index 304a8122..ca7b7903 100644 --- a/xorg/server/module/rdpPolyRectangle.c +++ b/xorg/server/module/rdpPolyRectangle.c @@ -95,6 +95,10 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects, int down; int lw; int cd; + int x1; + int y1; + int x2; + int y2; RegionRec clip_reg; RegionRec reg; @@ -113,28 +117,37 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects, 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++; From e83942fe0629c2bde960d05096abe00dd728a05d Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sun, 26 Jan 2014 11:28:46 -0800 Subject: [PATCH 3/8] xorg: work on xorg driver --- xorg/server/module/Makefile | 3 +- xorg/server/module/rdpComposite.c | 96 +------------------- xorg/server/module/rdpComposite.h | 4 - xorg/server/module/rdpPolyFillArc.c | 2 +- xorg/server/module/rdpTrapezoids.c | 135 ++++++++++++++++++++++++++++ xorg/server/module/rdpTrapezoids.h | 30 +++++++ xorg/server/xrdpdev/xrdpdev.c | 1 + 7 files changed, 171 insertions(+), 100 deletions(-) create mode 100644 xorg/server/module/rdpTrapezoids.c create mode 100644 xorg/server/module/rdpTrapezoids.h 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/rdpComposite.c b/xorg/server/module/rdpComposite.c index af922598..7ac6a084 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" @@ -105,7 +106,7 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, PictureScreenPtr ps; BoxRec box; - LLOGLN(0, ("rdpComposite:")); + LLOGLN(10, ("rdpComposite:")); pScreen = pDst->pDrawable->pScreen; dev = rdpGetDevFromScreen(pScreen); dev->counts.rdpCompositeCallCount++; @@ -134,96 +135,3 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, clientCon = clientCon->next; } } - -/******************************************************************************/ -static void -rdpTrapezoidsPre(rdpPtr dev, rdpClientCon *clientCon, PictureScreenPtr ps, - CARD8 op, PicturePtr pSrc, PicturePtr pDst, - PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, - int ntrap, xTrapezoid *traps, BoxPtr box) -{ -} - -/******************************************************************************/ -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; -} - -/******************************************************************************/ -static void -rdpTrapezoidsPost(rdpPtr dev, rdpClientCon *clientCon, PictureScreenPtr ps, - CARD8 op, PicturePtr pSrc, PicturePtr pDst, - PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, - int ntrap, xTrapezoid *traps, 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 -rdpTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, - PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, - int ntrap, xTrapezoid *traps) -{ - ScreenPtr pScreen; - rdpPtr dev; - rdpClientCon *clientCon; - PictureScreenPtr ps; - BoxRec box; - RegionRec reg; - int index; - - LLOGLN(0, ("rdpTrapezoids:")); - pScreen = pDst->pDrawable->pScreen; - dev = rdpGetDevFromScreen(pScreen); - dev->counts.rdpTrapezoidsCallCount++; - - rdpRegionInit(®, NullBox, 0); - for (index = 0; index < ntrap; index++) - { - LLOGLN(0, (" top %d bottom %d left p1 %d %d", - traps[index].top, traps[index].bottom, - traps[index].left.p1.x, traps[index].left.p1.y)); - //box.x1 = traps[index].left + pDst->pDrawable->x; - //box.y1 = traps[index].top + pDst->pDrawable->y; - //box.x2 = traps[index].right + pDst->pDrawable->x; - //box.y2 = traps[index].bottom + pDst->pDrawable->y; - } - ps = GetPictureScreen(pScreen); - clientCon = dev->clientConHead; - while (clientCon != NULL) - { - //rdpTrapezoidsPre(dev, clientCon, ps, op, pSrc, pDst, - // maskFormat, xSrc, ySrc, ntrap, traps, &box); - clientCon = clientCon->next; - } - /* do original call */ - rdpTrapezoidsOrg(ps, dev, op, pSrc, pDst, maskFormat, xSrc, ySrc, - ntrap, traps); - clientCon = dev->clientConHead; - while (clientCon != NULL) - { - //rdpTrapezoidsPost(dev, clientCon, ps, op, pSrc, pDst, - // maskFormat, xSrc, ySrc, ntrap, traps, &box); - clientCon = clientCon->next; - } -} diff --git a/xorg/server/module/rdpComposite.h b/xorg/server/module/rdpComposite.h index 9b922e9d..017cb41d 100644 --- a/xorg/server/module/rdpComposite.h +++ b/xorg/server/module/rdpComposite.h @@ -28,9 +28,5 @@ void rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height); -void -rdpTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, - PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, - int ntrap, xTrapezoid *traps); #endif diff --git a/xorg/server/module/rdpPolyFillArc.c b/xorg/server/module/rdpPolyFillArc.c index 438ed7b7..4bb12746 100644 --- a/xorg/server/module/rdpPolyFillArc.c +++ b/xorg/server/module/rdpPolyFillArc.c @@ -95,7 +95,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); diff --git a/xorg/server/module/rdpTrapezoids.c b/xorg/server/module/rdpTrapezoids.c new file mode 100644 index 00000000..491f9030 --- /dev/null +++ b/xorg/server/module/rdpTrapezoids.c @@ -0,0 +1,135 @@ +/* +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 +rdpTrapezoidsPre(rdpPtr dev, rdpClientCon *clientCon, PictureScreenPtr ps, + CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int ntrap, xTrapezoid *traps, BoxPtr box) +{ +} + +/******************************************************************************/ +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; +} + +/******************************************************************************/ +static void +rdpTrapezoidsPost(rdpPtr dev, rdpClientCon *clientCon, PictureScreenPtr ps, + CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int ntrap, xTrapezoid *traps, 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 +rdpTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, + PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, + int ntrap, xTrapezoid *traps) +{ + ScreenPtr pScreen; + rdpPtr dev; + rdpClientCon *clientCon; + PictureScreenPtr ps; + BoxRec box; + int dstx; + int dsty; + + LLOGLN(10, ("rdpTrapezoids:")); + pScreen = pDst->pDrawable->pScreen; + dev = rdpGetDevFromScreen(pScreen); + dev->counts.rdpTrapezoidsCallCount++; + dstx = traps[0].left.p1.x >> 16; + dsty = traps[0].left.p1.y >> 16; + miTrapezoidBounds(ntrap, traps, &box); + box.x1 += pDst->pDrawable->x; + box.y1 += pDst->pDrawable->y; + box.x2 += pDst->pDrawable->x; + box.y2 += pDst->pDrawable->y; + LLOGLN(10, ("%d %d %d %d %d %d", dstx, dsty, box.x1, box.y1, + box.x2, box.y2)); + ps = GetPictureScreen(pScreen); + clientCon = dev->clientConHead; + while (clientCon != NULL) + { + rdpTrapezoidsPre(dev, clientCon, ps, op, pSrc, pDst, + maskFormat, xSrc, ySrc, ntrap, traps, &box); + clientCon = clientCon->next; + } + /* do original call */ + rdpTrapezoidsOrg(ps, dev, op, pSrc, pDst, maskFormat, xSrc, ySrc, + ntrap, traps); + clientCon = dev->clientConHead; + while (clientCon != NULL) + { + rdpTrapezoidsPost(dev, clientCon, ps, op, pSrc, pDst, + maskFormat, xSrc, ySrc, ntrap, traps, &box); + clientCon = clientCon->next; + } +} 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 1afcdb0f..c6aa1559 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" From 48228cae2eaa0847b07f899811dd7f0ab8a7365e Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Tue, 28 Jan 2014 10:38:36 -0800 Subject: [PATCH 4/8] common: added shm to os_calls --- common/os_calls.c | 16 ++++++++++++++++ common/os_calls.h | 2 ++ 2 files changed, 18 insertions(+) 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 From 022c1e31f9f9cee15d7264fb0f520c1a795b73ef Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Tue, 28 Jan 2014 10:40:19 -0800 Subject: [PATCH 5/8] xup: call shmdt on disconnect --- xup/xup.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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; } From 6beb2364f38f5e53b0acb744ffc8225c9c13e492 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Tue, 28 Jan 2014 10:41:32 -0800 Subject: [PATCH 6/8] xorg: work on xorg driver --- xorg/server/module/rdpClientCon.c | 42 ++++++++++++++++++ xorg/server/module/rdpClientCon.h | 5 ++- xorg/server/module/rdpComposite.c | 58 +++--------------------- xorg/server/module/rdpCopyArea.c | 53 +++------------------- xorg/server/module/rdpCopyPlane.c | 57 +++--------------------- xorg/server/module/rdpDraw.c | 36 +++++++-------- xorg/server/module/rdpFillPolygon.c | 55 +++-------------------- xorg/server/module/rdpImageGlyphBlt.c | 57 +++--------------------- xorg/server/module/rdpImageText16.c | 55 +++-------------------- xorg/server/module/rdpImageText8.c | 55 +++-------------------- xorg/server/module/rdpPolyArc.c | 44 ++---------------- xorg/server/module/rdpPolyFillArc.c | 49 +++----------------- xorg/server/module/rdpPolyFillRect.c | 46 ++----------------- xorg/server/module/rdpPolyGlyphBlt.c | 25 +++++++++++ xorg/server/module/rdpPolyPoint.c | 52 +++------------------- xorg/server/module/rdpPolyRectangle.c | 56 +++-------------------- xorg/server/module/rdpPolySegment.c | 52 ++-------------------- xorg/server/module/rdpPolyText16.c | 55 +++-------------------- xorg/server/module/rdpPolyText8.c | 55 +++-------------------- xorg/server/module/rdpPolylines.c | 50 ++------------------- xorg/server/module/rdpPutImage.c | 64 +++++---------------------- xorg/server/module/rdpTrapezoids.c | 56 ++--------------------- xorg/server/xrdpdev/xrdpdev.c | 2 +- 23 files changed, 195 insertions(+), 884 deletions(-) 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 7ac6a084..7535d6c3 100644 --- a/xorg/server/module/rdpComposite.c +++ b/xorg/server/module/rdpComposite.c @@ -46,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, @@ -70,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, @@ -102,9 +67,9 @@ 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 = pDst->pDrawable->pScreen; @@ -114,24 +79,15 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, 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 48a54b99..708891f6 100644 --- a/xorg/server/module/rdpCopyArea.c +++ b/xorg/server/module/rdpCopyArea.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 -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, - RegionPtr reg) -{ -} - /******************************************************************************/ static RegionPtr rdpCopyAreaOrg(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, @@ -63,69 +53,38 @@ 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, - RegionPtr reg) -{ - - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDst)) - { - return; - } - rdpClientConAddDirtyScreenReg(dev, clientCon, reg); -} - /******************************************************************************/ 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; - RegionRec reg; LLOGLN(10, ("rdpCopyArea:")); dev = rdpGetDevFromScreen(pGC->pScreen); dev->counts.rdpCopyAreaCallCount++; - rdpRegionInit(&clip_reg, NullBox, 0); - cd = rdpDrawGetClip(dev, &clip_reg, pDst, pGC); - LLOGLN(10, ("rdpCopyArea: cd %d", cd)); 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)); if (cd == XRDP_CD_CLIP) { rdpRegionIntersect(®, &clip_reg, ®); } - clientCon = dev->clientConHead; - while (clientCon != NULL) - { - rdpCopyAreaPre(dev, clientCon, cd, &clip_reg, pSrc, pDst, pGC, - srcx, srcy, w, h, dstx, dsty, ®); - clientCon = clientCon->next; - } /* 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(®); 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..9d834500 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,30 +319,25 @@ 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)) + else { - box = rdpRegionExtents(®); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if ((num_clip_rects > 16) || (num_reg_rects > 16)) { - rdpClientConAddDirtyScreenBox(dev, clientCon, box); - 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); - clientCon = dev->clientConHead; - while (clientCon != NULL) + else { - rdpClientConAddDirtyScreenReg(dev, clientCon, ®); - clientCon = clientCon->next; + rdpRegionTranslate(®, dx, dy); + rdpRegionIntersect(®, ®, &clip); + rdpClientConAddAllReg(dev, ®, &(pWin->drawable)); } } rdpRegionUninit(®); 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/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/rdpPolyArc.c b/xorg/server/module/rdpPolyArc.c index e0a3d128..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,30 +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; - } - rdpClientConAddDirtyScreenReg(dev, clientCon, reg); -} - /******************************************************************************/ void rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) { rdpPtr dev; - rdpClientCon *clientCon; BoxRec box; int index; int cd; @@ -119,22 +91,12 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) { rdpRegionIntersect(®, &clip_reg, ®); } - clientCon = dev->clientConHead; - while (clientCon != NULL) - { - rdpPolyArcPre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, - narcs, parcs, ®); - clientCon = clientCon->next; - } /* 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 4bb12746..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; @@ -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 a3162d31..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,32 +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; - } - 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; @@ -99,26 +69,16 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, rdpRegionTranslate(reg, pDrawable->x, pDrawable->y); rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); + LLOGLN(10, ("rdpPolyFillRect: cd %d", cd)); if (cd == XRDP_CD_CLIP) { rdpRegionIntersect(reg, &clip_reg, reg); } - LLOGLN(10, ("rdpPolyFillRect: cd %d", cd)); - clientCon = dev->clientConHead; - while (clientCon != NULL) - { - rdpPolyFillRectPre(dev, clientCon, cd, &clip_reg, pDrawable, - pGC, nrectFill, prectInit, reg); - clientCon = clientCon->next; - } /* 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 df151b84..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,46 +51,19 @@ 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) -{ - RegionRec lreg; - - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) - { - return; - } - rdpRegionInit(&lreg, NullBox, 0); - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(&lreg, clip_reg, reg); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, &lreg); - rdpRegionUninit(&lreg); -} - /******************************************************************************/ 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); @@ -114,21 +78,15 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, 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 ca7b7903..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,35 +51,12 @@ 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; @@ -116,63 +84,49 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects, index = 0; while (index < nrects) { - 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); - /* left */ box.x1 = x1 - up; box.y1 = y1 - up; box.x2 = x1 + down; box.y2 = y2 + down; rdpRegionUnionRect(®, &box); - /* right */ box.x1 = x2 - up; box.y1 = y1 - up; box.x2 = x2 + down; box.y2 = y2 + down; rdpRegionUnionRect(®, &box); - /* 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 d242f736..98e4eb1f 100644 --- a/xorg/server/module/rdpPolySegment.c +++ b/xorg/server/module/rdpPolySegment.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 -rdpPolySegmentPre(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, int nseg, - xSegment *pSegs, RegionPtr reg) -{ -} - /******************************************************************************/ void rdpPolySegmentOrg(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs) @@ -59,38 +50,11 @@ rdpPolySegmentOrg(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs) GC_OP_EPILOGUE(pGC); } -/******************************************************************************/ -void -rdpPolySegmentPost(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, int nseg, - xSegment *pSegs, RegionPtr reg) -{ - RegionRec lreg; - - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) - { - return; - } - rdpRegionInit(&lreg, NullBox, 0); - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(&lreg, clip_reg, reg); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, &lreg); - rdpRegionUninit(&lreg); -} - /******************************************************************************/ void rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs) { rdpPtr dev; - rdpClientCon *clientCon; RegionRec clip_reg; RegionRec reg; int cd; @@ -120,24 +84,16 @@ rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs) rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); LLOGLN(10, ("rdpPolySegment: cd %d", cd)); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd == XRDP_CD_CLIP) { - rdpPolySegmentPre(dev, clientCon, cd, &clip_reg, pDrawable, - pGC, nseg, pSegs, ®); - clientCon = clientCon->next; + rdpRegionIntersect(®, &clip_reg, ®); } /* do original call */ rdpPolySegmentOrg(pDrawable, pGC, nseg, pSegs); - - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd != XRDP_CD_NODRAW) { - rdpPolySegmentPost(dev, clientCon, cd, &clip_reg, pDrawable, - pGC, nseg, pSegs, ®); - clientCon = clientCon->next; + 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 630f2827..da979e9f 100644 --- a/xorg/server/module/rdpPolylines.c +++ b/xorg/server/module/rdpPolylines.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 -rdpPolylinesPre(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, int mode, - int npt, DDXPointPtr pptInit, RegionPtr reg) -{ -} - /******************************************************************************/ static void rdpPolylinesOrg(DrawablePtr pDrawable, GCPtr pGC, int mode, @@ -60,39 +51,12 @@ rdpPolylinesOrg(DrawablePtr pDrawable, GCPtr pGC, int mode, GC_OP_EPILOGUE(pGC); } -/******************************************************************************/ -void -rdpPolylinesPost(rdpPtr dev, rdpClientCon *clientCon, - int cd, RegionPtr clip_reg, - DrawablePtr pDrawable, GCPtr pGC, int mode, - int npt, DDXPointPtr pptInit, RegionPtr reg) -{ - RegionRec lreg; - - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable)) - { - return; - } - rdpRegionInit(&lreg, NullBox, 0); - if (cd == XRDP_CD_CLIP) - { - rdpRegionIntersect(&lreg, clip_reg, reg); - } - rdpClientConAddDirtyScreenReg(dev, clientCon, &lreg); - rdpRegionUninit(&lreg); -} - /******************************************************************************/ void rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr pptInit) { rdpPtr dev; - rdpClientCon *clientCon; RegionRec clip_reg; RegionRec reg; int cd; @@ -122,21 +86,15 @@ rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, rdpRegionInit(&clip_reg, NullBox, 0); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); LLOGLN(10, ("rdpPolylines: cd %d", cd)); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd == XRDP_CD_CLIP) { - rdpPolylinesPre(dev, clientCon, cd, &clip_reg, pDrawable, - pGC, mode, npt, pptInit, ®); - clientCon = clientCon->next; + rdpRegionIntersect(®, &clip_reg, ®); } /* do original call */ rdpPolylinesOrg(pDrawable, pGC, mode, npt, pptInit); - clientCon = dev->clientConHead; - while (clientCon != NULL) + if (cd != XRDP_CD_NODRAW) { - rdpPolylinesPost(dev, clientCon, cd, &clip_reg, pDrawable, - pGC, mode, npt, pptInit, ®); - clientCon = clientCon->next; + 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, @@ -61,69 +52,38 @@ rdpPutImageOrg(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, GC_OP_EPILOGUE(pGC); } -/******************************************************************************/ -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) -{ - BoxRec box; - RegionRec reg; - - if (cd == XRDP_CD_NODRAW) - { - return; - } - if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDst)) - { - return; - } - 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; + RegionRec reg; int cd; + BoxRec box; 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); 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/rdpTrapezoids.c b/xorg/server/module/rdpTrapezoids.c index 491f9030..05b34ec4 100644 --- a/xorg/server/module/rdpTrapezoids.c +++ b/xorg/server/module/rdpTrapezoids.c @@ -44,15 +44,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 -rdpTrapezoidsPre(rdpPtr dev, rdpClientCon *clientCon, PictureScreenPtr ps, - CARD8 op, PicturePtr pSrc, PicturePtr pDst, - PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, - int ntrap, xTrapezoid *traps, BoxPtr box) -{ -} - /******************************************************************************/ static void rdpTrapezoidsOrg(PictureScreenPtr ps, rdpPtr dev, @@ -65,28 +56,6 @@ rdpTrapezoidsOrg(PictureScreenPtr ps, rdpPtr dev, ps->Trapezoids = rdpTrapezoids; } -/******************************************************************************/ -static void -rdpTrapezoidsPost(rdpPtr dev, rdpClientCon *clientCon, PictureScreenPtr ps, - CARD8 op, PicturePtr pSrc, PicturePtr pDst, - PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, - int ntrap, xTrapezoid *traps, 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 rdpTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, @@ -95,41 +64,24 @@ rdpTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, { ScreenPtr pScreen; rdpPtr dev; - rdpClientCon *clientCon; PictureScreenPtr ps; BoxRec box; - int dstx; - int dsty; + RegionRec reg; LLOGLN(10, ("rdpTrapezoids:")); pScreen = pDst->pDrawable->pScreen; dev = rdpGetDevFromScreen(pScreen); dev->counts.rdpTrapezoidsCallCount++; - dstx = traps[0].left.p1.x >> 16; - dsty = traps[0].left.p1.y >> 16; miTrapezoidBounds(ntrap, traps, &box); box.x1 += pDst->pDrawable->x; box.y1 += pDst->pDrawable->y; box.x2 += pDst->pDrawable->x; box.y2 += pDst->pDrawable->y; - LLOGLN(10, ("%d %d %d %d %d %d", dstx, dsty, box.x1, box.y1, - box.x2, box.y2)); + rdpRegionInit(®, &box, 0); ps = GetPictureScreen(pScreen); - clientCon = dev->clientConHead; - while (clientCon != NULL) - { - rdpTrapezoidsPre(dev, clientCon, ps, op, pSrc, pDst, - maskFormat, xSrc, ySrc, ntrap, traps, &box); - clientCon = clientCon->next; - } /* do original call */ rdpTrapezoidsOrg(ps, dev, op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, traps); - clientCon = dev->clientConHead; - while (clientCon != NULL) - { - rdpTrapezoidsPost(dev, clientCon, ps, op, pSrc, pDst, - maskFormat, xSrc, ySrc, ntrap, traps, &box); - clientCon = clientCon->next; - } + rdpClientConAddAllReg(dev, ®, pDst->pDrawable); + rdpRegionUninit(®); } diff --git a/xorg/server/xrdpdev/xrdpdev.c b/xorg/server/xrdpdev/xrdpdev.c index c6aa1559..33756389 100644 --- a/xorg/server/xrdpdev/xrdpdev.c +++ b/xorg/server/xrdpdev/xrdpdev.c @@ -532,7 +532,7 @@ 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; } From 97070b6fd90bcf48da805c42f8e0103831c5752a Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Tue, 28 Jan 2014 14:12:20 -0800 Subject: [PATCH 7/8] xorg: fixes for building with xserver v1.13+ --- xorg/server/module/rdpDraw.c | 4 ++++ xorg/server/module/rdpDraw.h | 14 ++++++++++++++ xorg/server/module/rdpPixmap.h | 9 ++------- xorg/server/module/rdpRandR.c | 6 ++++++ 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/xorg/server/module/rdpDraw.c b/xorg/server/module/rdpDraw.c index 9d834500..ef1edcf3 100644 --- a/xorg/server/module/rdpDraw.c +++ b/xorg/server/module/rdpDraw.c @@ -354,7 +354,11 @@ rdpCloseScreen(int index, ScreenPtr pScreen) LLOGLN(0, ("rdpCloseScreen:")); dev = rdpGetDevFromScreen(pScreen); dev->pScreen->CloseScreen = dev->CloseScreen; +#if XRDP_CLOSESCR == 1 /* before v1.13 */ rv = dev->pScreen->CloseScreen(index, pScreen); +#else + rv = dev->pScreen->CloseScreen(pScreen); +#endif dev->pScreen->CloseScreen = rdpCloseScreen; return rv; } 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/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/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; } From b4b73056fc8c119beb032d20fc763bc40af3efa9 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Tue, 28 Jan 2014 16:07:36 -0800 Subject: [PATCH 8/8] xorg: fixes for building with xserver v1.13+ --- xorg/server/module/rdpDraw.c | 21 +++++++++++++++++++-- xorg/server/xrdpdev/xrdpdev.c | 26 +++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/xorg/server/module/rdpDraw.c b/xorg/server/module/rdpDraw.c index ef1edcf3..b4e689af 100644 --- a/xorg/server/module/rdpDraw.c +++ b/xorg/server/module/rdpDraw.c @@ -344,6 +344,8 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) rdpRegionUninit(&clip); } +#if XRDP_CLOSESCR == 1 /* before v1.13 */ + /*****************************************************************************/ Bool rdpCloseScreen(int index, ScreenPtr pScreen) @@ -354,15 +356,30 @@ rdpCloseScreen(int index, ScreenPtr pScreen) LLOGLN(0, ("rdpCloseScreen:")); dev = rdpGetDevFromScreen(pScreen); dev->pScreen->CloseScreen = dev->CloseScreen; -#if XRDP_CLOSESCR == 1 /* before v1.13 */ rv = dev->pScreen->CloseScreen(index, pScreen); + dev->pScreen->CloseScreen = rdpCloseScreen; + 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); -#endif dev->pScreen->CloseScreen = rdpCloseScreen; return rv; } +#endif + /******************************************************************************/ WindowPtr rdpGetRootWindowPtr(ScreenPtr pScreen) diff --git a/xorg/server/xrdpdev/xrdpdev.c b/xorg/server/xrdpdev/xrdpdev.c index 33756389..7e5959ba 100644 --- a/xorg/server/xrdpdev/xrdpdev.c +++ b/xorg/server/xrdpdev/xrdpdev.c @@ -411,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; @@ -419,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; @@ -556,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; @@ -564,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; @@ -579,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;