Merge branch 'devel' of github.com:/neutrinolabs/xrdp into devel

ulab-next
Laxmikant Rashinkar 11 years ago
commit ec4791ac40

@ -42,6 +42,8 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
@ -3118,3 +3120,17 @@ g_text2bool(const char *s)
} }
return 0; 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);
}

@ -161,5 +161,7 @@ int APP_CC g_time1(void);
int APP_CC g_time2(void); int APP_CC g_time2(void);
int APP_CC g_time3(void); int APP_CC g_time3(void);
int APP_CC g_text2bool(const char *s); int APP_CC g_text2bool(const char *s);
void * APP_CC g_shmat(int shmid);
int APP_CC g_shmdt(const void *shmaddr);
#endif #endif

@ -5,7 +5,8 @@ rdpPolyRectangle.o rdpPolyArc.o rdpFillPolygon.o rdpPolyFillRect.o \
rdpPolyFillArc.o rdpPolyText8.o rdpPolyText16.o rdpImageText8.o \ rdpPolyFillArc.o rdpPolyText8.o rdpPolyText16.o rdpImageText8.o \
rdpImageText16.o rdpImageGlyphBlt.o rdpPolyGlyphBlt.o rdpPushPixels.o \ rdpImageText16.o rdpImageGlyphBlt.o rdpPolyGlyphBlt.o rdpPushPixels.o \
rdpCursor.o rdpMain.o rdpRandR.o rdpMisc.o rdpReg.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 \ CFLAGS = -g -O2 -Wall -fPIC -I/usr/include/xorg -I/usr/include/pixman-1 \
-I../../../common -I../../../common

@ -149,7 +149,8 @@ struct _rdpCounts
CARD32 rdpPushPixelsCallCount; /* 20 */ CARD32 rdpPushPixelsCallCount; /* 20 */
CARD32 rdpCompositeCallCount; CARD32 rdpCompositeCallCount;
CARD32 rdpCopyWindowCallCount; /* 22 */ CARD32 rdpCopyWindowCallCount; /* 22 */
CARD32 callCount[64 - 22]; CARD32 rdpTrapezoidsCallCount;
CARD32 callCount[64 - 23];
}; };
/* move this to common header */ /* move this to common header */
@ -177,6 +178,7 @@ struct _rdpRec
CloseScreenProcPtr CloseScreen; CloseScreenProcPtr CloseScreen;
CompositeProcPtr Composite; CompositeProcPtr Composite;
GlyphsProcPtr Glyphs; GlyphsProcPtr Glyphs;
TrapezoidsProcPtr Trapezoids;
/* keyboard and mouse */ /* keyboard and mouse */
miPointerScreenFuncPtr pCursorFuncs; miPointerScreenFuncPtr pCursorFuncs;

@ -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;
}

@ -143,6 +143,9 @@ rdpClientConAddDirtyScreenBox(rdpPtr dev, rdpClientCon *clientCon,
int int
rdpClientConAddDirtyScreen(rdpPtr dev, rdpClientCon *clientCon, rdpClientConAddDirtyScreen(rdpPtr dev, rdpClientCon *clientCon,
int x, int y, int cx, int cy); 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 #endif

@ -32,6 +32,7 @@ composite(alpha blending) calls
#include <xf86.h> #include <xf86.h>
#include <xf86_OSproc.h> #include <xf86_OSproc.h>
#include "mipict.h"
#include <picture.h> #include <picture.h>
#include "rdp.h" #include "rdp.h"
@ -45,17 +46,6 @@ composite(alpha blending) calls
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) 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 static void
rdpCompositeOrg(PictureScreenPtr ps, rdpPtr dev, rdpCompositeOrg(PictureScreenPtr ps, rdpPtr dev,
@ -69,30 +59,6 @@ rdpCompositeOrg(PictureScreenPtr ps, rdpPtr dev,
ps->Composite = rdpComposite; 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(&reg, box, 0);
if (pDst->pCompositeClip != 0)
{
rdpRegionIntersect(&reg, pDst->pCompositeClip, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/ /******************************************************************************/
void void
rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
@ -101,36 +67,27 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
{ {
ScreenPtr pScreen; ScreenPtr pScreen;
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon;
PictureScreenPtr ps; PictureScreenPtr ps;
BoxRec box; BoxRec box;
RegionRec reg;
LLOGLN(10, ("rdpComposite:")); LLOGLN(10, ("rdpComposite:"));
pScreen = pSrc->pDrawable->pScreen; pScreen = pDst->pDrawable->pScreen;
dev = rdpGetDevFromScreen(pScreen); dev = rdpGetDevFromScreen(pScreen);
dev->counts.rdpCompositeCallCount++; dev->counts.rdpCompositeCallCount++;
box.x1 = xDst + pDst->pDrawable->x; box.x1 = xDst + pDst->pDrawable->x;
box.y1 = yDst + pDst->pDrawable->y; box.y1 = yDst + pDst->pDrawable->y;
box.x2 = box.x1 + width; box.x2 = box.x1 + width;
box.y2 = box.y1 + height; box.y2 = box.y1 + height;
ps = GetPictureScreen(pScreen); rdpRegionInit(&reg, &box, 0);
clientCon = dev->clientConHead; if (pDst->pCompositeClip != NULL)
while (clientCon != NULL)
{ {
rdpCompositePre(dev, clientCon, ps, op, pSrc, pMask, pDst, rdpRegionIntersect(&reg, pDst->pCompositeClip, &reg);
xSrc, ySrc, xMask, yMask, xDst, yDst,
width, height, &box);
clientCon = clientCon->next;
} }
ps = GetPictureScreen(pScreen);
/* do original call */ /* do original call */
rdpCompositeOrg(ps, dev, op, pSrc, pMask, pDst, xSrc, ySrc, rdpCompositeOrg(ps, dev, op, pSrc, pMask, pDst, xSrc, ySrc,
xMask, yMask, xDst, yDst, width, height); xMask, yMask, xDst, yDst, width, height);
clientCon = dev->clientConHead; rdpClientConAddAllReg(dev, &reg, pDst->pDrawable);
while (clientCon != NULL) rdpRegionUninit(&reg);
{
rdpCompositePost(dev, clientCon, ps, op, pSrc, pMask, pDst,
xSrc, ySrc, xMask, yMask, xDst, yDst,
width, height, &box);
clientCon = clientCon->next;
}
} }

@ -39,15 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
/******************************************************************************/
static void
rdpCopyAreaPre(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
int srcx, int srcy, int w, int h, int dstx, int dsty)
{
}
/******************************************************************************/ /******************************************************************************/
static RegionPtr static RegionPtr
rdpCopyAreaOrg(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, rdpCopyAreaOrg(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
@ -62,70 +53,40 @@ rdpCopyAreaOrg(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
return rv; return rv;
} }
/******************************************************************************/
static void
rdpCopyAreaPost(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
int srcx, int srcy, int w, int h, int dstx, int dsty)
{
BoxRec box;
RegionRec reg;
if (cd == XRDP_CD_NODRAW)
{
return;
}
if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDst))
{
return;
}
box.x1 = dstx + pDst->x;
box.y1 = dsty + pDst->y;
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
rdpRegionInit(&reg, &box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/ /******************************************************************************/
RegionPtr RegionPtr
rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, rdpCopyArea(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)
{ {
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon;
RegionPtr rv; RegionPtr rv;
RegionRec clip_reg; RegionRec clip_reg;
RegionRec reg;
int cd; int cd;
BoxRec box;
LLOGLN(10, ("rdpCopyArea:")); LLOGLN(10, ("rdpCopyArea:"));
dev = rdpGetDevFromScreen(pGC->pScreen); dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpCopyAreaCallCount++; dev->counts.rdpCopyAreaCallCount++;
box.x1 = dstx + pDst->x;
box.y1 = dsty + pDst->y;
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
rdpRegionInit(&reg, &box, 0);
rdpRegionInit(&clip_reg, NullBox, 0); rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDst, pGC); cd = rdpDrawGetClip(dev, &clip_reg, pDst, pGC);
LLOGLN(10, ("rdpCopyArea: cd %d", cd)); LLOGLN(10, ("rdpCopyArea: cd %d", cd));
clientCon = dev->clientConHead; if (cd == XRDP_CD_CLIP)
while (clientCon != NULL)
{ {
rdpCopyAreaPre(dev, clientCon, cd, &clip_reg, pSrc, pDst, pGC, rdpRegionIntersect(&reg, &clip_reg, &reg);
srcx, srcy, w, h, dstx, dsty);
clientCon = clientCon->next;
} }
/* do original call */ /* do original call */
rv = rdpCopyAreaOrg(pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty); rv = rdpCopyAreaOrg(pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty);
clientCon = dev->clientConHead; if (cd != XRDP_CD_NODRAW)
while (clientCon != NULL)
{ {
rdpCopyAreaPost(dev, clientCon, cd, &clip_reg, pSrc, pDst, pGC, rdpClientConAddAllReg(dev, &reg, pDst);
srcx, srcy, w, h, dstx, dsty);
clientCon = clientCon->next;
} }
rdpRegionUninit(&clip_reg); rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
return rv; return rv;
} }

@ -39,16 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) 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 static RegionPtr
rdpCopyPlaneOrg(DrawablePtr pSrc, DrawablePtr pDst, rdpCopyPlaneOrg(DrawablePtr pSrc, DrawablePtr pDst,
@ -65,33 +55,6 @@ rdpCopyPlaneOrg(DrawablePtr pSrc, DrawablePtr pDst,
return rv; 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(&reg, box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/ /******************************************************************************/
RegionPtr RegionPtr
rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
@ -100,8 +63,8 @@ rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
{ {
RegionPtr rv; RegionPtr rv;
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon;
RegionRec clip_reg; RegionRec clip_reg;
RegionRec reg;
int cd; int cd;
BoxRec box; BoxRec box;
@ -112,28 +75,22 @@ rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
box.y1 = pDst->y + dsty; box.y1 = pDst->y + dsty;
box.x2 = box.x1 + w; box.x2 = box.x1 + w;
box.y2 = box.x1 + h; box.y2 = box.x1 + h;
rdpRegionInit(&reg, &box, 0);
rdpRegionInit(&clip_reg, NullBox, 0); rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDst, pGC); cd = rdpDrawGetClip(dev, &clip_reg, pDst, pGC);
LLOGLN(10, ("rdpCopyPlane: cd %d", cd)); LLOGLN(10, ("rdpCopyPlane: cd %d", cd));
clientCon = dev->clientConHead; if (cd == XRDP_CD_CLIP)
while (clientCon != NULL)
{ {
rdpCopyPlanePre(dev, clientCon, cd, &clip_reg, pSrc, pDst, rdpRegionIntersect(&reg, &clip_reg, &reg);
pGC, srcx, srcy, w, h,
dstx, dsty, bitPlane, &box);
clientCon = clientCon->next;
} }
/* do original call */ /* do original call */
rv = rdpCopyPlaneOrg(pSrc, pDst, pGC, srcx, srcy, w, h, rv = rdpCopyPlaneOrg(pSrc, pDst, pGC, srcx, srcy, w, h,
dstx, dsty, bitPlane); dstx, dsty, bitPlane);
clientCon = dev->clientConHead; if (cd != XRDP_CD_NODRAW)
while (clientCon != NULL)
{ {
rdpCopyPlanePost(dev, clientCon, cd, &clip_reg, pSrc, pDst, rdpClientConAddAllReg(dev, &reg, pDst);
pGC, srcx, srcy, w, h,
dstx, dsty, bitPlane, &box);
clientCon = clientCon->next;
} }
rdpRegionUninit(&clip_reg); rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
return rv; return rv;
} }

@ -289,7 +289,6 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion)
{ {
ScreenPtr pScreen; ScreenPtr pScreen;
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon;
RegionRec reg; RegionRec reg;
RegionRec clip; RegionRec clip;
int dx; int dx;
@ -297,7 +296,9 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion)
int num_clip_rects; int num_clip_rects;
int num_reg_rects; int num_reg_rects;
BoxPtr box; BoxPtr box;
BoxRec box1;
LLOGLN(10, ("rdpCopyWindow:"));
pScreen = pWin->drawable.pScreen; pScreen = pWin->drawable.pScreen;
dev = rdpGetDevFromScreen(pScreen); dev = rdpGetDevFromScreen(pScreen);
dev->counts.rdpCopyWindowCallCount++; dev->counts.rdpCopyWindowCallCount++;
@ -318,36 +319,33 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion)
if ((num_clip_rects == 0) || (num_reg_rects == 0)) if ((num_clip_rects == 0) || (num_reg_rects == 0))
{ {
rdpRegionUninit(&reg);
rdpRegionUninit(&clip);
return;
} }
else
if ((num_clip_rects > 16) && (num_reg_rects > 16))
{ {
box = rdpRegionExtents(&reg); if ((num_clip_rects > 16) || (num_reg_rects > 16))
clientCon = dev->clientConHead;
while (clientCon != NULL)
{ {
rdpClientConAddDirtyScreenBox(dev, clientCon, box); LLOGLN(10, ("rdpCopyWindow: big list"));
clientCon = clientCon->next; box = rdpRegionExtents(&reg);
} box1 = *box;
box1.x1 += dx;
box1.y1 += dy;
box1.x2 += dx;
box1.y2 += dy;
rdpClientConAddAllBox(dev, &box1, &(pWin->drawable));
} }
else else
{ {
rdpRegionTranslate(&reg, dx, dy); rdpRegionTranslate(&reg, dx, dy);
rdpRegionIntersect(&reg, &reg, &clip); rdpRegionIntersect(&reg, &reg, &clip);
clientCon = dev->clientConHead; rdpClientConAddAllReg(dev, &reg, &(pWin->drawable));
while (clientCon != NULL)
{
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
clientCon = clientCon->next;
} }
} }
rdpRegionUninit(&reg); rdpRegionUninit(&reg);
rdpRegionUninit(&clip); rdpRegionUninit(&clip);
} }
#if XRDP_CLOSESCR == 1 /* before v1.13 */
/*****************************************************************************/ /*****************************************************************************/
Bool Bool
rdpCloseScreen(int index, ScreenPtr pScreen) rdpCloseScreen(int index, ScreenPtr pScreen)
@ -363,6 +361,25 @@ rdpCloseScreen(int index, ScreenPtr pScreen)
return rv; return rv;
} }
#else
/*****************************************************************************/
Bool
rdpCloseScreen(ScreenPtr pScreen)
{
rdpPtr dev;
Bool rv;
LLOGLN(0, ("rdpCloseScreen:"));
dev = rdpGetDevFromScreen(pScreen);
dev->pScreen->CloseScreen = dev->CloseScreen;
rv = dev->pScreen->CloseScreen(pScreen);
dev->pScreen->CloseScreen = rdpCloseScreen;
return rv;
}
#endif
/******************************************************************************/ /******************************************************************************/
WindowPtr WindowPtr
rdpGetRootWindowPtr(ScreenPtr pScreen) rdpGetRootWindowPtr(ScreenPtr pScreen)

@ -25,8 +25,17 @@ misc draw calls
#define __RDPDRAW_H #define __RDPDRAW_H
#include <xorg-server.h> #include <xorg-server.h>
#include <xorgVersion.h>
#include <xf86.h> #include <xf86.h>
#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 */ /* true if drawable is window or pixmap is screen */
#define XRDP_DRAWABLE_IS_VISIBLE(_dev, _drw) \ #define XRDP_DRAWABLE_IS_VISIBLE(_dev, _drw) \
(((_drw)->type == DRAWABLE_WINDOW && ((WindowPtr)(_drw))->viewable) || \ (((_drw)->type == DRAWABLE_WINDOW && ((WindowPtr)(_drw))->viewable) || \
@ -69,8 +78,13 @@ int
rdpDrawItemRemoveAll(rdpPtr dev, rdpPixmapRec *priv); rdpDrawItemRemoveAll(rdpPtr dev, rdpPixmapRec *priv);
void void
rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion); rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion);
#if XRDP_CLOSESCR == 1
Bool Bool
rdpCloseScreen(int index, ScreenPtr pScreen); rdpCloseScreen(int index, ScreenPtr pScreen);
#else
Bool
rdpCloseScreen(ScreenPtr pScreen);
#endif
WindowPtr WindowPtr
rdpGetRootWindowPtr(ScreenPtr pScreen); rdpGetRootWindowPtr(ScreenPtr pScreen);
rdpPtr rdpPtr

@ -39,16 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) 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 void
rdpFillPolygonOrg(DrawablePtr pDrawable, GCPtr pGC, rdpFillPolygonOrg(DrawablePtr pDrawable, GCPtr pGC,
@ -62,33 +52,6 @@ rdpFillPolygonOrg(DrawablePtr pDrawable, GCPtr pGC,
GC_OP_EPILOGUE(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(&reg, box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/ /******************************************************************************/
void void
rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC, rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
@ -96,8 +59,8 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
DDXPointPtr pPts) DDXPointPtr pPts)
{ {
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon;
RegionRec clip_reg; RegionRec clip_reg;
RegionRec reg;
int cd; int cd;
int maxx; int maxx;
int maxy; int maxy;
@ -135,24 +98,20 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
box.x2 = pDrawable->x + maxx + 1; box.x2 = pDrawable->x + maxx + 1;
box.y2 = pDrawable->y + maxy + 1; box.y2 = pDrawable->y + maxy + 1;
} }
rdpRegionInit(&reg, &box, 0);
rdpRegionInit(&clip_reg, NullBox, 0); rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpFillPolygon: cd %d", cd)); LLOGLN(10, ("rdpFillPolygon: cd %d", cd));
clientCon = dev->clientConHead; if (cd == XRDP_CD_CLIP)
while (clientCon != NULL)
{ {
rdpFillPolygonPre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpRegionIntersect(&reg, &clip_reg, &reg);
shape, mode, count, pPts, &box);
clientCon = clientCon->next;
} }
/* do original call */ /* do original call */
rdpFillPolygonOrg(pDrawable, pGC, shape, mode, count, pPts); rdpFillPolygonOrg(pDrawable, pGC, shape, mode, count, pPts);
clientCon = dev->clientConHead; if (cd != XRDP_CD_NODRAW)
while (clientCon != NULL)
{ {
rdpFillPolygonPost(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpClientConAddAllReg(dev, &reg, pDrawable);
shape, mode, count, pPts, &box);
clientCon = clientCon->next;
} }
rdpRegionUninit(&clip_reg); rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
} }

@ -96,7 +96,7 @@ rdpGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
PictureScreenPtr ps; PictureScreenPtr ps;
LLOGLN(10, ("rdpGlyphs:")); LLOGLN(10, ("rdpGlyphs:"));
pScreen = pSrc->pDrawable->pScreen; pScreen = pDst->pDrawable->pScreen;
dev = rdpGetDevFromScreen(pScreen); dev = rdpGetDevFromScreen(pScreen);
ps = GetPictureScreen(pScreen); ps = GetPictureScreen(pScreen);
rdpGlyphsOrg(ps, dev, op, pSrc, pDst, maskFormat, xSrc, ySrc, rdpGlyphsOrg(ps, dev, op, pSrc, pDst, maskFormat, xSrc, ySrc,

@ -39,17 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) 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 static void
rdpImageGlyphBltOrg(DrawablePtr pDrawable, GCPtr pGC, rdpImageGlyphBltOrg(DrawablePtr pDrawable, GCPtr pGC,
@ -63,34 +52,6 @@ rdpImageGlyphBltOrg(DrawablePtr pDrawable, GCPtr pGC,
GC_OP_EPILOGUE(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(&reg, box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/ /******************************************************************************/
void void
rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
@ -98,8 +59,8 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
CharInfoPtr *ppci, pointer pglyphBase) CharInfoPtr *ppci, pointer pglyphBase)
{ {
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon;
RegionRec clip_reg; RegionRec clip_reg;
RegionRec reg;
int cd; int cd;
BoxRec box; BoxRec box;
@ -107,24 +68,20 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
dev = rdpGetDevFromScreen(pGC->pScreen); dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpImageGlyphBltCallCount++; dev->counts.rdpImageGlyphBltCallCount++;
GetTextBoundingBox(pDrawable, pGC->font, x, y, nglyph, &box); GetTextBoundingBox(pDrawable, pGC->font, x, y, nglyph, &box);
rdpRegionInit(&reg, &box, 0);
rdpRegionInit(&clip_reg, NullBox, 0); rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpImageGlyphBlt: cd %d", cd)); LLOGLN(10, ("rdpImageGlyphBlt: cd %d", cd));
clientCon = dev->clientConHead; if (cd == XRDP_CD_CLIP)
while (clientCon != NULL)
{ {
rdpImageGlyphBltPre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpRegionIntersect(&reg, &clip_reg, &reg);
x, y, nglyph, ppci, pglyphBase, &box);
clientCon = clientCon->next;
} }
/* do original call */ /* do original call */
rdpImageGlyphBltOrg(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); rdpImageGlyphBltOrg(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
clientCon = dev->clientConHead; if (cd != XRDP_CD_NODRAW)
while (clientCon != NULL)
{ {
rdpImageGlyphBltPost(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpClientConAddAllReg(dev, &reg, pDrawable);
x, y, nglyph, ppci, pglyphBase, &box);
clientCon = clientCon->next;
} }
rdpRegionUninit(&clip_reg); rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
} }

@ -39,16 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) 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 static void
rdpImageText16Org(DrawablePtr pDrawable, GCPtr pGC, rdpImageText16Org(DrawablePtr pDrawable, GCPtr pGC,
@ -61,41 +51,14 @@ rdpImageText16Org(DrawablePtr pDrawable, GCPtr pGC,
GC_OP_EPILOGUE(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(&reg, box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/ /******************************************************************************/
void void
rdpImageText16(DrawablePtr pDrawable, GCPtr pGC, rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
int x, int y, int count, unsigned short *chars) int x, int y, int count, unsigned short *chars)
{ {
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon;
RegionRec clip_reg; RegionRec clip_reg;
RegionRec reg;
int cd; int cd;
BoxRec box; BoxRec box;
@ -103,24 +66,20 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
dev = rdpGetDevFromScreen(pGC->pScreen); dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpImageText16CallCount++; dev->counts.rdpImageText16CallCount++;
GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box);
rdpRegionInit(&reg, &box, 0);
rdpRegionInit(&clip_reg, NullBox, 0); rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpImageText16: cd %d", cd)); LLOGLN(10, ("rdpImageText16: cd %d", cd));
clientCon = dev->clientConHead; if (cd == XRDP_CD_CLIP)
while (clientCon != NULL)
{ {
rdpImageText16Pre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpRegionIntersect(&reg, &clip_reg, &reg);
x, y, count, chars, &box);
clientCon = clientCon->next;
} }
/* do original call */ /* do original call */
rdpImageText16Org(pDrawable, pGC, x, y, count, chars); rdpImageText16Org(pDrawable, pGC, x, y, count, chars);
clientCon = dev->clientConHead; if (cd != XRDP_CD_NODRAW)
while (clientCon != NULL)
{ {
rdpImageText16Post(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpClientConAddAllReg(dev, &reg, pDrawable);
x, y, count, chars, &box);
clientCon = clientCon->next;
} }
rdpRegionUninit(&clip_reg); rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
} }

@ -39,16 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) 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 static void
rdpImageText8Org(DrawablePtr pDrawable, GCPtr pGC, rdpImageText8Org(DrawablePtr pDrawable, GCPtr pGC,
@ -61,41 +51,14 @@ rdpImageText8Org(DrawablePtr pDrawable, GCPtr pGC,
GC_OP_EPILOGUE(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(&reg, box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/ /******************************************************************************/
void void
rdpImageText8(DrawablePtr pDrawable, GCPtr pGC, rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
int x, int y, int count, char *chars) int x, int y, int count, char *chars)
{ {
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon;
RegionRec clip_reg; RegionRec clip_reg;
RegionRec reg;
int cd; int cd;
BoxRec box; BoxRec box;
@ -103,24 +66,20 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
dev = rdpGetDevFromScreen(pGC->pScreen); dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpImageText8CallCount++; dev->counts.rdpImageText8CallCount++;
GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box);
rdpRegionInit(&reg, &box, 0);
rdpRegionInit(&clip_reg, NullBox, 0); rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpImageText8: cd %d", cd)); LLOGLN(10, ("rdpImageText8: cd %d", cd));
clientCon = dev->clientConHead; if (cd == XRDP_CD_CLIP)
while (clientCon != NULL)
{ {
rdpImageText8Pre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpRegionIntersect(&reg, &clip_reg, &reg);
x, y, count, chars, &box);
clientCon = clientCon->next;
} }
/* do original call */ /* do original call */
rdpImageText8Org(pDrawable, pGC, x, y, count, chars); rdpImageText8Org(pDrawable, pGC, x, y, count, chars);
clientCon = dev->clientConHead; if (cd != XRDP_CD_NODRAW)
while (clientCon != NULL)
{ {
rdpImageText8Post(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpClientConAddAllReg(dev, &reg, pDrawable);
x, y, count, chars, &box);
clientCon = clientCon->next;
} }
rdpRegionUninit(&clip_reg); rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
} }

@ -24,13 +24,8 @@ pixmap calls
#ifndef __RDPPIXMAP_H #ifndef __RDPPIXMAP_H
#define __RDPPIXAMP_H #define __RDPPIXAMP_H
#ifndef XORG_VERSION_NUMERIC #include <xorg-server.h>
#warning XORG_VERSION_NUMERIC not defined, need #include <xorgVersion.h> #include <xorgVersion.h>
#endif
#ifndef XORG_VERSION_CURRENT
#warning XORG_VERSION_CURRENT not defined
#endif
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 5, 0, 0, 0) #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 5, 0, 0, 0)
/* 1.1, 1.2, 1.3, 1.4 */ /* 1.1, 1.2, 1.3, 1.4 */

@ -39,15 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) 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 static void
rdpPolyArcOrg(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) rdpPolyArcOrg(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
@ -59,34 +50,11 @@ rdpPolyArcOrg(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
/******************************************************************************/
static void
rdpPolyArcPost(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs,
RegionPtr reg)
{
if (cd == XRDP_CD_NODRAW)
{
return;
}
if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable))
{
return;
}
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(reg, clip_reg, reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, reg);
}
/******************************************************************************/ /******************************************************************************/
void void
rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
{ {
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon;
BoxRec box; BoxRec box;
int index; int index;
int cd; int cd;
@ -95,7 +63,7 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
RegionRec clip_reg; RegionRec clip_reg;
RegionRec reg; RegionRec reg;
LLOGLN(10, ("rdpPolyArc:")); LLOGLN(0, ("rdpPolyArc:"));
dev = rdpGetDevFromScreen(pGC->pScreen); dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolyArcCallCount++; dev->counts.rdpPolyArcCallCount++;
rdpRegionInit(&reg, NullBox, 0); rdpRegionInit(&reg, NullBox, 0);
@ -119,22 +87,16 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
rdpRegionInit(&clip_reg, NullBox, 0); rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpPolyArc: cd %d", cd)); LLOGLN(10, ("rdpPolyArc: cd %d", cd));
clientCon = dev->clientConHead; if (cd == XRDP_CD_CLIP)
while (clientCon != NULL)
{ {
rdpPolyArcPre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpRegionIntersect(&reg, &clip_reg, &reg);
narcs, parcs, &reg);
clientCon = clientCon->next;
} }
/* do original call */ /* do original call */
rdpPolyArcOrg(pDrawable, pGC, narcs, parcs); rdpPolyArcOrg(pDrawable, pGC, narcs, parcs);
clientCon = dev->clientConHead; if (cd != XRDP_CD_NODRAW)
while (clientCon != NULL)
{ {
rdpPolyArcPost(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpClientConAddAllReg(dev, &reg, pDrawable);
narcs, parcs, &reg);
clientCon = clientCon->next;
} }
rdpRegionUninit(&reg);
rdpRegionUninit(&clip_reg); rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
} }

@ -39,15 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) 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 static void
rdpPolyFillArcOrg(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) 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); 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 void
rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
{ {
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon;
BoxRec box; BoxRec box;
int index; int index;
int cd; int cd;
@ -95,7 +63,7 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
RegionRec clip_reg; RegionRec clip_reg;
RegionRec reg; RegionRec reg;
LLOGLN(0, ("rdpPolyFillArc:")); LLOGLN(10, ("rdpPolyFillArc:"));
dev = rdpGetDevFromScreen(pGC->pScreen); dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolyFillArcCallCount++; dev->counts.rdpPolyFillArcCallCount++;
rdpRegionInit(&reg, NullBox, 0); rdpRegionInit(&reg, NullBox, 0);
@ -119,23 +87,16 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
rdpRegionInit(&clip_reg, NullBox, 0); rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpPolyFillArc: cd %d", cd)); LLOGLN(10, ("rdpPolyFillArc: cd %d", cd));
clientCon = dev->clientConHead; if (cd == XRDP_CD_CLIP)
while (clientCon != NULL)
{ {
rdpPolyFillArcPre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpRegionIntersect(&reg, &clip_reg, &reg);
narcs, parcs, &reg);
clientCon = clientCon->next;
} }
/* do original call */ /* do original call */
rdpPolyFillArcOrg(pDrawable, pGC, narcs, parcs); rdpPolyFillArcOrg(pDrawable, pGC, narcs, parcs);
clientCon = dev->clientConHead; if (cd != XRDP_CD_NODRAW)
while (clientCon != NULL)
{ {
rdpPolyFillArcPost(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpClientConAddAllReg(dev, &reg, pDrawable);
narcs, parcs, &reg);
clientCon = clientCon->next;
} }
rdpRegionUninit(&reg);
rdpRegionUninit(&clip_reg); rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
} }

@ -39,16 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) 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 static void
rdpPolyFillRectOrg(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, rdpPolyFillRectOrg(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
@ -61,36 +51,12 @@ rdpPolyFillRectOrg(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
/******************************************************************************/
static void
rdpPolyFillRectPost(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC,
int nrectFill, xRectangle *prectInit,
RegionPtr reg)
{
if (cd == XRDP_CD_NODRAW)
{
return;
}
if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable))
{
return;
}
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(reg, clip_reg, reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, reg);
}
/******************************************************************************/ /******************************************************************************/
void void
rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
xRectangle *prectInit) xRectangle *prectInit)
{ {
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon;
RegionRec clip_reg; RegionRec clip_reg;
RegionPtr reg; RegionPtr reg;
int cd; int cd;
@ -104,21 +70,15 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
rdpRegionInit(&clip_reg, NullBox, 0); rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpPolyFillRect: cd %d", cd)); LLOGLN(10, ("rdpPolyFillRect: cd %d", cd));
clientCon = dev->clientConHead; if (cd == XRDP_CD_CLIP)
while (clientCon != NULL)
{ {
rdpPolyFillRectPre(dev, clientCon, cd, &clip_reg, pDrawable, rdpRegionIntersect(reg, &clip_reg, reg);
pGC, nrectFill, prectInit, reg);
clientCon = clientCon->next;
} }
/* do original call */ /* do original call */
rdpPolyFillRectOrg(pDrawable, pGC, nrectFill, prectInit); rdpPolyFillRectOrg(pDrawable, pGC, nrectFill, prectInit);
clientCon = dev->clientConHead; if (cd != XRDP_CD_NODRAW)
while (clientCon != NULL)
{ {
rdpPolyFillRectPost(dev, clientCon, cd, &clip_reg, pDrawable, rdpClientConAddAllReg(dev, reg, pDrawable);
pGC, nrectFill, prectInit, reg);
clientCon = clientCon->next;
} }
rdpRegionUninit(&clip_reg); rdpRegionUninit(&clip_reg);
rdpRegionDestroy(reg); rdpRegionDestroy(reg);

@ -32,6 +32,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "rdp.h" #include "rdp.h"
#include "rdpDraw.h" #include "rdpDraw.h"
#include "rdpClientCon.h"
#include "rdpReg.h"
#define LOG_LEVEL 1 #define LOG_LEVEL 1
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
@ -56,7 +58,30 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
int x, int y, unsigned int nglyph, int x, int y, unsigned int nglyph,
CharInfoPtr *ppci, pointer pglyphBase) CharInfoPtr *ppci, pointer pglyphBase)
{ {
rdpPtr dev;
RegionRec clip_reg;
RegionRec reg;
int cd;
BoxRec box;
LLOGLN(0, ("rdpPolyGlyphBlt:")); LLOGLN(0, ("rdpPolyGlyphBlt:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolyGlyphBltCallCount++;
GetTextBoundingBox(pDrawable, pGC->font, x, y, nglyph, &box);
rdpRegionInit(&reg, &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(&reg, &clip_reg, &reg);
}
/* do original call */ /* do original call */
rdpPolyGlyphBltOrg(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); rdpPolyGlyphBltOrg(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
if (cd != XRDP_CD_NODRAW)
{
rdpClientConAddAllReg(dev, &reg, pDrawable);
}
rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
} }

@ -39,15 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) 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 static void
rdpPolyPointOrg(DrawablePtr pDrawable, GCPtr pGC, int mode, rdpPolyPointOrg(DrawablePtr pDrawable, GCPtr pGC, int mode,
@ -60,69 +51,43 @@ rdpPolyPointOrg(DrawablePtr pDrawable, GCPtr pGC, int mode,
GC_OP_EPILOGUE(pGC); GC_OP_EPILOGUE(pGC);
} }
/******************************************************************************/
static void
rdpPolyPointPost(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC, int mode,
int npt, DDXPointPtr in_pts, RegionPtr reg)
{
if (cd == XRDP_CD_NODRAW)
{
return;
}
if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable))
{
return;
}
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(reg, clip_reg, reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, reg);
}
/******************************************************************************/ /******************************************************************************/
void void
rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
int npt, DDXPointPtr in_pts) int npt, DDXPointPtr in_pts)
{ {
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon;
RegionRec clip_reg; RegionRec clip_reg;
RegionRec reg; RegionRec reg;
int cd; int cd;
int index;
BoxRec box;
LLOGLN(0, ("rdpPolyPoint:")); LLOGLN(10, ("rdpPolyPoint:"));
dev = rdpGetDevFromScreen(pGC->pScreen); dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolyPointCallCount++; dev->counts.rdpPolyPointCallCount++;
rdpRegionInit(&reg, NullBox, 0); rdpRegionInit(&reg, 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(&reg, &box);
}
rdpRegionInit(&clip_reg, NullBox, 0); rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpPolyPoint: cd %d", cd)); LLOGLN(10, ("rdpPolyPoint: cd %d", cd));
if (cd == XRDP_CD_CLIP)
clientCon = dev->clientConHead;
while (clientCon != NULL)
{ {
rdpPolyPointPre(dev, clientCon, cd, &clip_reg, pDrawable, rdpRegionIntersect(&reg, &clip_reg, &reg);
pGC, mode, npt, in_pts, &reg);
clientCon = clientCon->next;
} }
/* do original call */ /* do original call */
rdpPolyPointOrg(pDrawable, pGC, mode, npt, in_pts); rdpPolyPointOrg(pDrawable, pGC, mode, npt, in_pts);
if (cd != XRDP_CD_NODRAW)
clientCon = dev->clientConHead;
while (clientCon != NULL)
{ {
rdpPolyPointPost(dev, clientCon, cd, &clip_reg, pDrawable, rdpClientConAddAllReg(dev, &reg, pDrawable);
pGC, mode, npt, in_pts, &reg);
clientCon = clientCon->next;
} }
rdpRegionUninit(&clip_reg); rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg); rdpRegionUninit(&reg);
} }

@ -39,15 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) 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 static void
rdpPolyRectangleOrg(DrawablePtr pDrawable, GCPtr pGC, int nrects, rdpPolyRectangleOrg(DrawablePtr pDrawable, GCPtr pGC, int nrects,
@ -60,41 +51,22 @@ rdpPolyRectangleOrg(DrawablePtr pDrawable, GCPtr pGC, int nrects,
GC_OP_EPILOGUE(pGC); 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 void
rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects, rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
xRectangle *rects) xRectangle *rects)
{ {
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon;
BoxRec box; BoxRec box;
int index; int index;
int up; int up;
int down; int down;
int lw; int lw;
int cd; int cd;
int x1;
int y1;
int x2;
int y2;
RegionRec clip_reg; RegionRec clip_reg;
RegionRec reg; RegionRec reg;
@ -112,54 +84,49 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
index = 0; index = 0;
while (index < nrects) while (index < nrects)
{ {
x1 = rects[index].x + pDrawable->x;
box.x1 = (rects[index].x + pDrawable->x) - up; y1 = rects[index].y + pDrawable->y;
box.y1 = (rects[index].y + pDrawable->y) - up; x2 = x1 + rects[index].width;
box.x2 = box.x1 + rects[index].width + (up + down); y2 = y1 + rects[index].height;
box.y2 = box.y1 + lw; /* top */
box.x1 = x1 - up;
box.y1 = y1 - up;
box.x2 = x2 + down;
box.y2 = y1 + down;
rdpRegionUnionRect(&reg, &box); rdpRegionUnionRect(&reg, &box);
/* left */
box.x1 = (rects[index].x + pDrawable->x) - up; box.x1 = x1 - up;
box.y1 = (rects[index].y + pDrawable->y) + down; box.y1 = y1 - up;
box.x2 = box.x1 + lw; box.x2 = x1 + down;
box.y2 = box.y1 + rects[index].height - (up + down); box.y2 = y2 + down;
rdpRegionUnionRect(&reg, &box); rdpRegionUnionRect(&reg, &box);
/* right */
box.x1 = ((rects[index].x + rects[index].width) + pDrawable->x) - up; box.x1 = x2 - up;
box.y1 = (rects[index].y + pDrawable->y) + down; box.y1 = y1 - up;
box.x2 = box.x1 + lw; box.x2 = x2 + down;
box.y2 = box.y1 + rects[index].height - (up + down); box.y2 = y2 + down;
rdpRegionUnionRect(&reg, &box); rdpRegionUnionRect(&reg, &box);
/* bottom */
box.x1 = (rects[index].x + pDrawable->x) - up; box.x1 = x1 - up;
box.y1 = ((rects[index].y + rects[index].height) + pDrawable->y) - up; box.y1 = y2 - up;
box.x2 = box.x1 + rects[index].width + (up + down); box.x2 = x2 + down;
box.y2 = box.y1 + lw; box.y2 = y2 + down;
rdpRegionUnionRect(&reg, &box); rdpRegionUnionRect(&reg, &box);
index++; index++;
} }
rdpRegionInit(&clip_reg, NullBox, 0); rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpPolyRectangle: cd %d", cd)); LLOGLN(10, ("rdpPolyRectangle: cd %d", cd));
if (cd == XRDP_CD_CLIP)
clientCon = dev->clientConHead;
while (clientCon != NULL)
{ {
rdpPolyRectanglePre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpRegionIntersect(&reg, &clip_reg, &reg);
nrects, rects, &reg);
clientCon = clientCon->next;
} }
/* do original call */ /* do original call */
rdpPolyRectangleOrg(pDrawable, pGC, nrects, rects); rdpPolyRectangleOrg(pDrawable, pGC, nrects, rects);
clientCon = dev->clientConHead; if (cd != XRDP_CD_NODRAW)
while (clientCon != NULL)
{ {
rdpPolyRectanglePost(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpClientConAddAllReg(dev, &reg, pDrawable);
nrects, rects, &reg);
clientCon = clientCon->next;
} }
rdpRegionUninit(&reg);
rdpRegionUninit(&clip_reg); rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
} }

@ -32,6 +32,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "rdp.h" #include "rdp.h"
#include "rdpDraw.h" #include "rdpDraw.h"
#include "rdpClientCon.h"
#include "rdpReg.h"
#define LOG_LEVEL 1 #define LOG_LEVEL 1
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
@ -52,7 +54,46 @@ rdpPolySegmentOrg(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs)
void void
rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs) rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs)
{ {
LLOGLN(0, ("rdpPolySegment:")); rdpPtr dev;
RegionRec clip_reg;
RegionRec reg;
int cd;
int index;
int x1;
int y1;
int x2;
int y2;
BoxRec box;
LLOGLN(10, ("rdpPolySegment:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolySegmentCallCount++;
rdpRegionInit(&reg, 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(&reg, &box);
}
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpPolySegment: cd %d", cd));
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, &clip_reg, &reg);
}
/* do original call */ /* do original call */
rdpPolySegmentOrg(pDrawable, pGC, nseg, pSegs); rdpPolySegmentOrg(pDrawable, pGC, nseg, pSegs);
if (cd != XRDP_CD_NODRAW)
{
rdpClientConAddAllReg(dev, &reg, pDrawable);
}
rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
} }

@ -39,16 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) 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 static int
rdpPolyText16Org(DrawablePtr pDrawable, GCPtr pGC, rdpPolyText16Org(DrawablePtr pDrawable, GCPtr pGC,
@ -63,33 +53,6 @@ rdpPolyText16Org(DrawablePtr pDrawable, GCPtr pGC,
return rv; 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(&reg, box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/ /******************************************************************************/
int int
rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC, rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
@ -97,8 +60,8 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
{ {
int rv; int rv;
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon;
RegionRec clip_reg; RegionRec clip_reg;
RegionRec reg;
int cd; int cd;
BoxRec box; BoxRec box;
@ -106,25 +69,21 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
dev = rdpGetDevFromScreen(pGC->pScreen); dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolyText16CallCount++; dev->counts.rdpPolyText16CallCount++;
GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box);
rdpRegionInit(&reg, &box, 0);
rdpRegionInit(&clip_reg, NullBox, 0); rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpPolyText16: cd %d", cd)); LLOGLN(10, ("rdpPolyText16: cd %d", cd));
clientCon = dev->clientConHead; if (cd == XRDP_CD_CLIP)
while (clientCon != NULL)
{ {
rdpPolyText16Pre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpRegionIntersect(&reg, &clip_reg, &reg);
x, y, count, chars, &box);
clientCon = clientCon->next;
} }
/* do original call */ /* do original call */
rv = rdpPolyText16Org(pDrawable, pGC, x, y, count, chars); rv = rdpPolyText16Org(pDrawable, pGC, x, y, count, chars);
clientCon = dev->clientConHead; if (cd != XRDP_CD_NODRAW)
while (clientCon != NULL)
{ {
rdpPolyText16Post(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpClientConAddAllReg(dev, &reg, pDrawable);
x, y, count, chars, &box);
clientCon = clientCon->next;
} }
rdpRegionUninit(&clip_reg); rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
return rv; return rv;
} }

@ -39,16 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) 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 static int
rdpPolyText8Org(DrawablePtr pDrawable, GCPtr pGC, rdpPolyText8Org(DrawablePtr pDrawable, GCPtr pGC,
@ -63,33 +53,6 @@ rdpPolyText8Org(DrawablePtr pDrawable, GCPtr pGC,
return rv; 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(&reg, box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/ /******************************************************************************/
int int
rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC, rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
@ -97,8 +60,8 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
{ {
int rv; int rv;
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon;
RegionRec clip_reg; RegionRec clip_reg;
RegionRec reg;
int cd; int cd;
BoxRec box; BoxRec box;
@ -106,25 +69,21 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
dev = rdpGetDevFromScreen(pGC->pScreen); dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolyText8CallCount++; dev->counts.rdpPolyText8CallCount++;
GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box); GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box);
rdpRegionInit(&reg, &box, 0);
rdpRegionInit(&clip_reg, NullBox, 0); rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC); cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpPolyText8: cd %d", cd)); LLOGLN(10, ("rdpPolyText8: cd %d", cd));
clientCon = dev->clientConHead; if (cd == XRDP_CD_CLIP)
while (clientCon != NULL)
{ {
rdpPolyText8Pre(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpRegionIntersect(&reg, &clip_reg, &reg);
x, y, count, chars, &box);
clientCon = clientCon->next;
} }
/* do original call */ /* do original call */
rv = rdpPolyText8Org(pDrawable, pGC, x, y, count, chars); rv = rdpPolyText8Org(pDrawable, pGC, x, y, count, chars);
clientCon = dev->clientConHead; if (cd != XRDP_CD_NODRAW)
while (clientCon != NULL)
{ {
rdpPolyText8Post(dev, clientCon, cd, &clip_reg, pDrawable, pGC, rdpClientConAddAllReg(dev, &reg, pDrawable);
x, y, count, chars, &box);
clientCon = clientCon->next;
} }
rdpRegionUninit(&clip_reg); rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
return rv; return rv;
} }

@ -32,6 +32,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "rdp.h" #include "rdp.h"
#include "rdpDraw.h" #include "rdpDraw.h"
#include "rdpClientCon.h"
#include "rdpReg.h"
#define LOG_LEVEL 1 #define LOG_LEVEL 1
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
@ -54,7 +56,46 @@ void
rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode,
int npt, DDXPointPtr pptInit) int npt, DDXPointPtr pptInit)
{ {
LLOGLN(0, ("rdpPolylines:")); rdpPtr dev;
RegionRec clip_reg;
RegionRec reg;
int cd;
int index;
int x1;
int y1;
int x2;
int y2;
BoxRec box;
LLOGLN(10, ("rdpPolylines:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolylinesCallCount++;
rdpRegionInit(&reg, 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(&reg, &box);
}
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpPolylines: cd %d", cd));
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, &clip_reg, &reg);
}
/* do original call */ /* do original call */
rdpPolylinesOrg(pDrawable, pGC, mode, npt, pptInit); rdpPolylinesOrg(pDrawable, pGC, mode, npt, pptInit);
if (cd != XRDP_CD_NODRAW)
{
rdpClientConAddAllReg(dev, &reg, pDrawable);
}
rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
} }

@ -39,15 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define LLOGLN(_level, _args) \ #define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) 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 static void
rdpPutImageOrg(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, 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); 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(&reg, &box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/ /******************************************************************************/
void void
rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y,
int w, int h, int leftPad, int format, char *pBits) int w, int h, int leftPad, int format, char *pBits)
{ {
rdpPtr dev; rdpPtr dev;
rdpClientCon *clientCon;
RegionRec clip_reg; RegionRec clip_reg;
RegionRec reg;
int cd; int cd;
BoxRec box;
LLOGLN(10, ("rdpPutImage:")); LLOGLN(10, ("rdpPutImage:"));
dev = rdpGetDevFromScreen(pGC->pScreen); dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPutImageCallCount++; dev->counts.rdpPutImageCallCount++;
box.x1 = x + pDst->x;
box.y1 = y + pDst->y;
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
rdpRegionInit(&reg, &box, 0);
rdpRegionInit(&clip_reg, NullBox, 0); rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDst, pGC); cd = rdpDrawGetClip(dev, &clip_reg, pDst, pGC);
LLOGLN(10, ("rdpPutImage: cd %d", cd)); LLOGLN(10, ("rdpPutImage: cd %d", cd));
clientCon = dev->clientConHead; if (cd == XRDP_CD_CLIP)
while (clientCon != NULL)
{ {
rdpPutImagePre(dev, clientCon, cd, &clip_reg, pDst, pGC, depth, x, y, rdpRegionIntersect(&reg, &clip_reg, &reg);
w, h, leftPad, format, pBits);
clientCon = clientCon->next;
} }
/* do original call */ /* do original call */
rdpPutImageOrg(pDst, pGC, depth, x, y, w, h, leftPad, format, pBits); rdpPutImageOrg(pDst, pGC, depth, x, y, w, h, leftPad, format, pBits);
clientCon = dev->clientConHead; if (cd != XRDP_CD_NODRAW)
while (clientCon != NULL)
{ {
rdpPutImagePost(dev, clientCon, cd, &clip_reg, pDst, pGC, depth, x, y, rdpClientConAddAllReg(dev, &reg, pDst);
w, h, leftPad, format, pBits);
clientCon = clientCon->next;
} }
rdpRegionUninit(&clip_reg); rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
} }

@ -27,6 +27,7 @@ RandR draw calls
/* this should be before all X11 .h files */ /* this should be before all X11 .h files */
#include <xorg-server.h> #include <xorg-server.h>
#include <xorgVersion.h>
/* all driver need this */ /* all driver need this */
#include <xf86.h> #include <xf86.h>
@ -141,8 +142,13 @@ rdpRRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
RRGetInfo(pScreen, 1); RRGetInfo(pScreen, 1);
LLOGLN(0, (" screen resized to %dx%d", pScreen->width, pScreen->height)); LLOGLN(0, (" screen resized to %dx%d", pScreen->width, pScreen->height));
RRScreenSizeNotify(pScreen); RRScreenSizeNotify(pScreen);
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0)
xf86EnableDisableFBAccess(pScreen->myNum, FALSE); xf86EnableDisableFBAccess(pScreen->myNum, FALSE);
xf86EnableDisableFBAccess(pScreen->myNum, TRUE); xf86EnableDisableFBAccess(pScreen->myNum, TRUE);
#else
xf86EnableDisableFBAccess(xf86Screens[pScreen->myNum], FALSE);
xf86EnableDisableFBAccess(xf86Screens[pScreen->myNum], TRUE);
#endif
return TRUE; return TRUE;
} }

@ -0,0 +1,87 @@
/*
Copyright 2014 Jay Sorg
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* this should be before all X11 .h files */
#include <xorg-server.h>
/* all driver need this */
#include <xf86.h>
#include <xf86_OSproc.h>
#include "mipict.h"
#include <picture.h>
#include "rdp.h"
#include "rdpDraw.h"
#include "rdpClientCon.h"
#include "rdpReg.h"
#include "rdpTrapezoids.h"
/******************************************************************************/
#define LOG_LEVEL 1
#define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
/******************************************************************************/
static void
rdpTrapezoidsOrg(PictureScreenPtr ps, rdpPtr dev,
CARD8 op, PicturePtr pSrc, PicturePtr pDst,
PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
int ntrap, xTrapezoid *traps)
{
ps->Trapezoids = dev->Trapezoids;
ps->Trapezoids(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, traps);
ps->Trapezoids = rdpTrapezoids;
}
/******************************************************************************/
void
rdpTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
int ntrap, xTrapezoid *traps)
{
ScreenPtr pScreen;
rdpPtr dev;
PictureScreenPtr ps;
BoxRec box;
RegionRec reg;
LLOGLN(10, ("rdpTrapezoids:"));
pScreen = pDst->pDrawable->pScreen;
dev = rdpGetDevFromScreen(pScreen);
dev->counts.rdpTrapezoidsCallCount++;
miTrapezoidBounds(ntrap, traps, &box);
box.x1 += pDst->pDrawable->x;
box.y1 += pDst->pDrawable->y;
box.x2 += pDst->pDrawable->x;
box.y2 += pDst->pDrawable->y;
rdpRegionInit(&reg, &box, 0);
ps = GetPictureScreen(pScreen);
/* do original call */
rdpTrapezoidsOrg(ps, dev, op, pSrc, pDst, maskFormat, xSrc, ySrc,
ntrap, traps);
rdpClientConAddAllReg(dev, &reg, pDst->pDrawable);
rdpRegionUninit(&reg);
}

@ -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

@ -47,6 +47,7 @@ This is the main driver file
#include "rdpRandR.h" #include "rdpRandR.h"
#include "rdpMisc.h" #include "rdpMisc.h"
#include "rdpComposite.h" #include "rdpComposite.h"
#include "rdpTrapezoids.h"
#include "rdpGlyphs.h" #include "rdpGlyphs.h"
#include "rdpPixmap.h" #include "rdpPixmap.h"
#include "rdpClientCon.h" #include "rdpClientCon.h"
@ -410,7 +411,11 @@ rdpWakeupHandler1(pointer blockData, int result, pointer pReadmask)
/*****************************************************************************/ /*****************************************************************************/
static Bool static Bool
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0)
rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
#else
rdpScreenInit(ScreenPtr pScreen, int argc, char **argv)
#endif
{ {
ScrnInfoPtr pScrn; ScrnInfoPtr pScrn;
rdpPtr dev; rdpPtr dev;
@ -418,7 +423,7 @@ rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
Bool vis_found; Bool vis_found;
PictureScreenPtr ps; PictureScreenPtr ps;
pScrn = xf86Screens[scrnIndex]; pScrn = xf86Screens[pScreen->myNum];
dev = XRDPPTR(pScrn); dev = XRDPPTR(pScrn);
dev->pScreen = pScreen; dev->pScreen = pScreen;
@ -531,6 +536,9 @@ rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
/* glyphs */ /* glyphs */
dev->Glyphs = ps->Glyphs; dev->Glyphs = ps->Glyphs;
ps->Glyphs = rdpGlyphs; ps->Glyphs = rdpGlyphs;
/* trapezoids */
dev->Trapezoids = ps->Trapezoids;
ps->Trapezoids = rdpTrapezoids;
} }
RegisterBlockAndWakeupHandlers(rdpBlockHandler1, rdpWakeupHandler1, pScreen); RegisterBlockAndWakeupHandlers(rdpBlockHandler1, rdpWakeupHandler1, pScreen);
@ -552,7 +560,11 @@ rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
/*****************************************************************************/ /*****************************************************************************/
static Bool static Bool
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0)
rdpSwitchMode(int a, DisplayModePtr b, int c) rdpSwitchMode(int a, DisplayModePtr b, int c)
#else
rdpSwitchMode(ScrnInfoPtr a, DisplayModePtr b)
#endif
{ {
LLOGLN(0, ("rdpSwitchMode:")); LLOGLN(0, ("rdpSwitchMode:"));
return TRUE; return TRUE;
@ -560,14 +572,22 @@ rdpSwitchMode(int a, DisplayModePtr b, int c)
/*****************************************************************************/ /*****************************************************************************/
static void static void
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0)
rdpAdjustFrame(int a, int b, int c, int d) rdpAdjustFrame(int a, int b, int c, int d)
#else
rdpAdjustFrame(ScrnInfoPtr a, int b, int c)
#endif
{ {
LLOGLN(10, ("rdpAdjustFrame:")); LLOGLN(10, ("rdpAdjustFrame:"));
} }
/*****************************************************************************/ /*****************************************************************************/
static Bool static Bool
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0)
rdpEnterVT(int a, int b) rdpEnterVT(int a, int b)
#else
rdpEnterVT(ScrnInfoPtr a)
#endif
{ {
LLOGLN(0, ("rdpEnterVT:")); LLOGLN(0, ("rdpEnterVT:"));
return TRUE; return TRUE;
@ -575,14 +595,22 @@ rdpEnterVT(int a, int b)
/*****************************************************************************/ /*****************************************************************************/
static void static void
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0)
rdpLeaveVT(int a, int b) rdpLeaveVT(int a, int b)
#else
rdpLeaveVT(ScrnInfoPtr a)
#endif
{ {
LLOGLN(0, ("rdpLeaveVT:")); LLOGLN(0, ("rdpLeaveVT:"));
} }
/*****************************************************************************/ /*****************************************************************************/
static ModeStatus static ModeStatus
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 13, 0, 0, 0)
rdpValidMode(int a, DisplayModePtr b, Bool c, int d) rdpValidMode(int a, DisplayModePtr b, Bool c, int d)
#else
rdpValidMode(ScrnInfoPtr a, DisplayModePtr b, Bool c, int d)
#endif
{ {
LLOGLN(0, ("rdpValidMode:")); LLOGLN(0, ("rdpValidMode:"));
return 0; return 0;

@ -21,9 +21,6 @@
#include "xup.h" #include "xup.h"
#include "log.h" #include "log.h"
#include <sys/ipc.h>
#include <sys/shm.h>
#define LOG_LEVEL 1 #define LOG_LEVEL 1
#define LLOG(_level, _args) \ #define LLOG(_level, _args) \
do { if (_level < LOG_LEVEL) { g_write _args ; } } while (0) do { if (_level < LOG_LEVEL) { g_write _args ; } } while (0)
@ -899,7 +896,7 @@ lib_mod_process_orders(struct mod *mod, int type, struct stream *s)
if (mod->screen_shmem_id == 0) if (mod->screen_shmem_id == 0)
{ {
mod->screen_shmem_id = shmem_id; 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) if (mod->screen_shmem_pixels != 0)
{ {
@ -1062,6 +1059,11 @@ lib_mod_signal(struct mod *mod)
int DEFAULT_CC int DEFAULT_CC
lib_mod_end(struct mod *mod) 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; return 0;
} }

Loading…
Cancel
Save