xorg: work on xorg driver

ulab-next
Jay Sorg 11 years ago
parent 022c1e31f9
commit 6beb2364f3

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

@ -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(&reg, box, 0);
if (pDst->pCompositeClip != 0)
{
rdpRegionIntersect(&reg, pDst->pCompositeClip, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
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(&reg, &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(&reg, pDst->pCompositeClip, &reg);
}
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, &reg, pDst->pDrawable);
rdpRegionUninit(&reg);
}

@ -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(&reg, &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(&reg, &clip_reg, &reg);
}
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
rdpCopyAreaPre(dev, clientCon, cd, &clip_reg, pSrc, pDst, pGC,
srcx, srcy, w, h, dstx, dsty, &reg);
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, &reg);
clientCon = clientCon->next;
rdpClientConAddAllReg(dev, &reg, pDst);
}
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) \
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(&reg, box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
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(&reg, &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(&reg, &clip_reg, &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, &reg, pDst);
}
rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
return rv;
}

@ -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(&reg);
rdpRegionUninit(&clip);
return;
}
if ((num_clip_rects > 16) && (num_reg_rects > 16))
else
{
box = rdpRegionExtents(&reg);
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(&reg);
box1 = *box;
box1.x1 += dx;
box1.y1 += dy;
box1.x2 += dx;
box1.y2 += dy;
rdpClientConAddAllBox(dev, &box1, &(pWin->drawable));
}
}
else
{
rdpRegionTranslate(&reg, dx, dy);
rdpRegionIntersect(&reg, &reg, &clip);
clientCon = dev->clientConHead;
while (clientCon != NULL)
else
{
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
clientCon = clientCon->next;
rdpRegionTranslate(&reg, dx, dy);
rdpRegionIntersect(&reg, &reg, &clip);
rdpClientConAddAllReg(dev, &reg, &(pWin->drawable));
}
}
rdpRegionUninit(&reg);

@ -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(&reg, box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
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(&reg, &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(&reg, &clip_reg, &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, &reg, pDrawable);
}
rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
}

@ -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(&reg, box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
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(&reg, &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(&reg, &clip_reg, &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, &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) \
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(&reg, box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
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(&reg, &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(&reg, &clip_reg, &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, &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) \
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(&reg, box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
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(&reg, &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(&reg, &clip_reg, &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, &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) \
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(&reg, &clip_reg, &reg);
}
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
rdpPolyArcPre(dev, clientCon, cd, &clip_reg, pDrawable, pGC,
narcs, parcs, &reg);
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, &reg);
clientCon = clientCon->next;
rdpClientConAddAllReg(dev, &reg, pDrawable);
}
rdpRegionUninit(&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) \
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, &reg);
clientCon = clientCon->next;
rdpRegionIntersect(&reg, &clip_reg, &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, &reg);
clientCon = clientCon->next;
rdpClientConAddAllReg(dev, &reg, pDrawable);
}
rdpRegionUninit(&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) \
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);

@ -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(&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 */
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) \
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(&reg, 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, &reg);
clientCon = clientCon->next;
rdpRegionIntersect(&reg, &clip_reg, &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, &reg);
clientCon = clientCon->next;
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) \
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(&reg, &box);
/* left */
box.x1 = x1 - up;
box.y1 = y1 - up;
box.x2 = x1 + down;
box.y2 = y2 + down;
rdpRegionUnionRect(&reg, &box);
/* right */
box.x1 = x2 - up;
box.y1 = y1 - up;
box.x2 = x2 + down;
box.y2 = y2 + down;
rdpRegionUnionRect(&reg, &box);
/* bottom */
box.x1 = x1 - up;
box.y1 = y2 - up;
box.x2 = x2 + down;
box.y2 = y2 + down;
rdpRegionUnionRect(&reg, &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, &reg);
clientCon = clientCon->next;
rdpRegionIntersect(&reg, &clip_reg, &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, &reg);
clientCon = clientCon->next;
rdpClientConAddAllReg(dev, &reg, pDrawable);
}
rdpRegionUninit(&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) \
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, &reg);
clientCon = clientCon->next;
rdpRegionIntersect(&reg, &clip_reg, &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, &reg);
clientCon = clientCon->next;
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) \
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(&reg, box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
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(&reg, &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(&reg, &clip_reg, &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, &reg, pDrawable);
}
rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
return rv;
}

@ -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(&reg, box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
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(&reg, &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(&reg, &clip_reg, &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, &reg, pDrawable);
}
rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
return rv;
}

@ -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, &reg);
clientCon = clientCon->next;
rdpRegionIntersect(&reg, &clip_reg, &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, &reg);
clientCon = clientCon->next;
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) \
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(&reg, &box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
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(&reg, &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(&reg, &clip_reg, &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, &reg, pDst);
}
rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
}

@ -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(&reg, box, 0);
if (pDst->pCompositeClip != 0)
{
rdpRegionIntersect(&reg, pDst->pCompositeClip, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
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(&reg, &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, &reg, pDst->pDrawable);
rdpRegionUninit(&reg);
}

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

Loading…
Cancel
Save