xorg: work on xorg driver

ulab-next
Jay Sorg 11 years ago
parent 320ce8ba47
commit f39ba98a4f

@ -38,6 +38,30 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define RDPCLAMP(_val, _lo, _hi) \
(_val) < (_lo) ? (_lo) : (_val) > (_hi) ? (_hi) : (_val)
#define XRDP_CD_NODRAW 0
#define XRDP_CD_NOCLIP 1
#define XRDP_CD_CLIP 2
#if 0
#define RegionCopy DONOTUSE
#define RegionTranslate DONOTUSE
#define RegionNotEmpty DONOTUSE
#define RegionIntersect DONOTUSE
#define RegionContainsRect DONOTUSE
#define RegionInit DONOTUSE
#define RegionUninit DONOTUSE
#define RegionFromRects DONOTUSE
#define RegionDestroy DONOTUSE
#define RegionCreate DONOTUSE
#define RegionUnion DONOTUSE
#define RegionSubtract DONOTUSE
#define RegionInverse DONOTUSE
#define RegionExtents DONOTUSE
#define RegionReset DONOTUSE
#define RegionBreak DONOTUSE
#define RegionUnionRect DONOTUSE
#endif
struct image_data
{
int width;
@ -101,6 +125,33 @@ typedef struct _rdpPixmapRec * rdpPixmapPtr;
#define GETPIXPRIV(_dev, _pPixmap) (rdpPixmapPtr) \
rdpGetPixmapPrivate(&((_pPixmap)->devPrivates), (_dev)->privateKeyRecPixmap)
struct _rdpCounts
{
CARD32 rdpFillSpansCallCount; /* 1 */
CARD32 rdpSetSpansCallCount;
CARD32 rdpPutImageCallCount;
CARD32 rdpCopyAreaCallCount;
CARD32 rdpCopyPlaneCallCount;
CARD32 rdpPolyPointCallCount;
CARD32 rdpPolylinesCallCount;
CARD32 rdpPolySegmentCallCount;
CARD32 rdpPolyRectangleCallCount;
CARD32 rdpPolyArcCallCount; /* 10 */
CARD32 rdpFillPolygonCallCount;
CARD32 rdpPolyFillRectCallCount;
CARD32 rdpPolyFillArcCallCount;
CARD32 rdpPolyText8CallCount;
CARD32 rdpPolyText16CallCount;
CARD32 rdpImageText8CallCount;
CARD32 rdpImageText16CallCount;
CARD32 rdpImageGlyphBltCallCount;
CARD32 rdpPolyGlyphBltCallCount;
CARD32 rdpPushPixelsCallCount; /* 20 */
CARD32 rdpCompositeCallCount;
CARD32 rdpCopyWindowCallCount; /* 22 */
CARD32 callCount[64 - 22];
};
/* move this to common header */
struct _rdpRec
{
@ -169,6 +220,8 @@ struct _rdpRec
int conNumber;
struct _rdpCounts counts;
};
typedef struct _rdpRec rdpRec;
typedef struct _rdpRec * rdpPtr;

@ -32,6 +32,7 @@
#include "rdp.h"
#include "rdpDraw.h"
#include "rdpClientCon.h"
#include "rdpReg.h"
#define LOG_LEVEL 1
#define LLOGLN(_level, _args) \

@ -1881,7 +1881,7 @@ rdpDeferredUpdateCallback(OsTimerPtr timer, CARD32 now, pointer arg)
}
rdpClientConEndUpdate(clientCon->dev, clientCon);
rdpRegionDestroy(clientCon->dirtyRegion);
clientCon->dirtyRegion = RegionCreate(NullBox, 0);
clientCon->dirtyRegion = rdpRegionCreate(NullBox, 0);
return 0;
}

@ -90,7 +90,7 @@ rdpCompositePost(rdpPtr dev, rdpClientCon *clientCon,
rdpRegionIntersect(&reg, pDst->pCompositeClip, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
RegionUninit(&reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
@ -108,6 +108,7 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
LLOGLN(10, ("rdpComposite:"));
pScreen = pSrc->pDrawable->pScreen;
dev = rdpGetDevFromScreen(pScreen);
dev->counts.rdpCompositeCallCount++;
box.x1 = xDst + pDst->pDrawable->x;
box.y1 = yDst + pDst->pDrawable->y;
box.x2 = box.x1 + width;

@ -69,20 +69,14 @@ rdpCopyAreaPost(rdpPtr dev, rdpClientCon *clientCon,
DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
int srcx, int srcy, int w, int h, int dstx, int dsty)
{
WindowPtr pDstWnd;
BoxRec box;
RegionRec reg;
if (cd == 0)
if (cd == XRDP_CD_NODRAW)
{
return;
}
if (pDst->type != DRAWABLE_WINDOW)
{
return;
}
pDstWnd = (WindowPtr) pDst;
if (pDstWnd->viewable == FALSE)
if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDst))
{
return;
}
@ -91,12 +85,12 @@ rdpCopyAreaPost(rdpPtr dev, rdpClientCon *clientCon,
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
rdpRegionInit(&reg, &box, 0);
if (cd == 2)
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
RegionUninit(&reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
@ -112,6 +106,7 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
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));
@ -131,6 +126,6 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
srcx, srcy, w, h, dstx, dsty);
clientCon = clientCon->next;
}
RegionUninit(&clip_reg);
rdpRegionUninit(&clip_reg);
return rv;
}

@ -32,11 +32,23 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "rdp.h"
#include "rdpDraw.h"
#include "rdpClientCon.h"
#include "rdpReg.h"
#define LOG_LEVEL 1
#define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
/******************************************************************************/
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,
@ -53,6 +65,33 @@ 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,
@ -60,10 +99,41 @@ rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
int dstx, int dsty, unsigned long bitPlane)
{
RegionPtr rv;
rdpPtr dev;
rdpClientCon *clientCon;
RegionRec clip_reg;
int cd;
BoxRec box;
LLOGLN(0, ("rdpCopyPlane:"));
LLOGLN(10, ("rdpCopyPlane:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpCopyPlaneCallCount++;
box.x1 = pDst->x + dstx;
box.y1 = pDst->y + dsty;
box.x2 = box.x1 + w;
box.y2 = box.x1 + h;
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDst, pGC);
LLOGLN(10, ("rdpCopyPlane: cd %d", cd));
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
rdpCopyPlanePre(dev, clientCon, cd, &clip_reg, pSrc, pDst,
pGC, srcx, srcy, w, h,
dstx, dsty, bitPlane, &box);
clientCon = clientCon->next;
}
/* do original call */
rv = rdpCopyPlaneOrg(pSrc, pDst, pGC, srcx, srcy, w, h,
dstx, dsty, bitPlane);
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
rdpCopyPlanePost(dev, clientCon, cd, &clip_reg, pSrc, pDst,
pGC, srcx, srcy, w, h,
dstx, dsty, bitPlane, &box);
clientCon = clientCon->next;
}
rdpRegionUninit(&clip_reg);
return rv;
}

@ -109,7 +109,7 @@ rdpDrawGetClip(rdpPtr dev, RegionPtr pRegion, DrawablePtr pDrawable, GCPtr pGC)
temp = &pWindow->clipList;
}
if (RegionNotEmpty(temp))
if (rdpRegionNotEmpty(temp))
{
switch (pGC->clientClipType)
{
@ -300,6 +300,7 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion)
pScreen = pWin->drawable.pScreen;
dev = rdpGetDevFromScreen(pScreen);
dev->counts.rdpCopyWindowCallCount++;
rdpRegionInit(&reg, NullBox, 0);
rdpRegionCopy(&reg, pOldRegion);

@ -32,11 +32,23 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "rdp.h"
#include "rdpDraw.h"
#include "rdpClientCon.h"
#include "rdpReg.h"
#define LOG_LEVEL 1
#define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
/******************************************************************************/
void
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,
@ -50,13 +62,97 @@ 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,
int shape, int mode, int count,
DDXPointPtr pPts)
{
LLOGLN(0, ("rdpFillPolygon:"));
rdpPtr dev;
rdpClientCon *clientCon;
RegionRec clip_reg;
int cd;
int maxx;
int maxy;
int minx;
int miny;
int index;
int x;
int y;
BoxRec box;
LLOGLN(10, ("rdpFillPolygon:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpFillPolygonCallCount++;
box.x1 = 0;
box.y1 = 0;
box.x2 = 0;
box.y2 = 0;
if (count > 0)
{
maxx = pPts[0].x;
maxy = pPts[0].y;
minx = maxx;
miny = maxy;
for (index = 1; index < count; index++)
{
x = pPts[index].x;
y = pPts[index].y;
maxx = RDPMAX(x, maxx);
minx = RDPMIN(x, minx);
maxy = RDPMAX(y, maxy);
miny = RDPMIN(y, miny);
}
box.x1 = pDrawable->x + minx;
box.y1 = pDrawable->y + miny;
box.x2 = pDrawable->x + maxx + 1;
box.y2 = pDrawable->y + maxy + 1;
}
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpFillPolygon: cd %d", cd));
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
rdpFillPolygonPre(dev, clientCon, cd, &clip_reg, pDrawable, pGC,
shape, mode, count, pPts, &box);
clientCon = clientCon->next;
}
/* do original call */
rdpFillPolygonOrg(pDrawable, pGC, shape, mode, count, pPts);
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
rdpFillPolygonPost(dev, clientCon, cd, &clip_reg, pDrawable, pGC,
shape, mode, count, pPts, &box);
clientCon = clientCon->next;
}
rdpRegionUninit(&clip_reg);
}

@ -40,7 +40,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
/******************************************************************************/
void
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,
int x, int y, unsigned int nglyph,
CharInfoPtr *ppci, pointer pglyphBase)
@ -52,13 +63,68 @@ 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,
int x, int y, unsigned int nglyph,
CharInfoPtr *ppci, pointer pglyphBase)
{
rdpPtr dev;
rdpClientCon *clientCon;
RegionRec clip_reg;
int cd;
BoxRec box;
LLOGLN(0, ("rdpImageGlyphBlt:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpImageGlyphBltCallCount++;
GetTextBoundingBox(pDrawable, pGC->font, x, y, nglyph, &box);
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpImageGlyphBlt: cd %d", cd));
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
rdpImageGlyphBltPre(dev, clientCon, cd, &clip_reg, pDrawable, pGC,
x, y, nglyph, ppci, pglyphBase, &box);
clientCon = clientCon->next;
}
/* do original call */
rdpImageGlyphBltOrg(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
rdpImageGlyphBltPost(dev, clientCon, cd, &clip_reg, pDrawable, pGC,
x, y, nglyph, ppci, pglyphBase, &box);
clientCon = clientCon->next;
}
rdpRegionUninit(&clip_reg);
}

@ -40,7 +40,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
/******************************************************************************/
void
static void
rdpImageText16Pre(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC,
@ -50,7 +50,7 @@ rdpImageText16Pre(rdpPtr dev, rdpClientCon *clientCon,
}
/******************************************************************************/
void
static void
rdpImageText16Org(DrawablePtr pDrawable, GCPtr pGC,
int x, int y, int count, unsigned short *chars)
{
@ -62,7 +62,7 @@ rdpImageText16Org(DrawablePtr pDrawable, GCPtr pGC,
}
/******************************************************************************/
void
static void
rdpImageText16Post(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC,
@ -71,7 +71,7 @@ rdpImageText16Post(rdpPtr dev, rdpClientCon *clientCon,
{
RegionRec reg;
if (cd == 0)
if (cd == XRDP_CD_NODRAW)
{
return;
}
@ -80,12 +80,12 @@ rdpImageText16Post(rdpPtr dev, rdpClientCon *clientCon,
return;
}
rdpRegionInit(&reg, box, 0);
if (cd == 2)
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
RegionUninit(&reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
@ -101,6 +101,7 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
LLOGLN(10, ("rdpImageText16:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpImageText16CallCount++;
GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box);
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
@ -121,5 +122,5 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
x, y, count, chars, &box);
clientCon = clientCon->next;
}
RegionUninit(&clip_reg);
rdpRegionUninit(&clip_reg);
}

@ -40,7 +40,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
/******************************************************************************/
void
static void
rdpImageText8Pre(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC,
@ -50,7 +50,7 @@ rdpImageText8Pre(rdpPtr dev, rdpClientCon *clientCon,
}
/******************************************************************************/
void
static void
rdpImageText8Org(DrawablePtr pDrawable, GCPtr pGC,
int x, int y, int count, char *chars)
{
@ -62,7 +62,7 @@ rdpImageText8Org(DrawablePtr pDrawable, GCPtr pGC,
}
/******************************************************************************/
void
static void
rdpImageText8Post(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC,
@ -71,7 +71,7 @@ rdpImageText8Post(rdpPtr dev, rdpClientCon *clientCon,
{
RegionRec reg;
if (cd == 0)
if (cd == XRDP_CD_NODRAW)
{
return;
}
@ -80,12 +80,12 @@ rdpImageText8Post(rdpPtr dev, rdpClientCon *clientCon,
return;
}
rdpRegionInit(&reg, box, 0);
if (cd == 2)
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
RegionUninit(&reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
@ -101,6 +101,7 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
LLOGLN(10, ("rdpImageText8:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpImageText8CallCount++;
GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box);
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
@ -121,5 +122,5 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
x, y, count, chars, &box);
clientCon = clientCon->next;
}
RegionUninit(&clip_reg);
rdpRegionUninit(&clip_reg);
}

@ -32,13 +32,24 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "rdp.h"
#include "rdpDraw.h"
#include "rdpClientCon.h"
#include "rdpReg.h"
#define LOG_LEVEL 1
#define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
/******************************************************************************/
void
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)
{
GC_OP_VARS;
@ -48,11 +59,82 @@ rdpPolyArcOrg(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
GC_OP_EPILOGUE(pGC);
}
/******************************************************************************/
static void
rdpPolyArcPost(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs,
RegionPtr reg)
{
if (cd == XRDP_CD_NODRAW)
{
return;
}
if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable))
{
return;
}
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(reg, clip_reg, reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, reg);
}
/******************************************************************************/
void
rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
{
LLOGLN(0, ("rdpPolyArc:"));
rdpPtr dev;
rdpClientCon *clientCon;
BoxRec box;
int index;
int cd;
int lw;
int extra;
RegionRec clip_reg;
RegionRec reg;
LLOGLN(10, ("rdpPolyArc:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolyArcCallCount++;
rdpRegionInit(&reg, NullBox, 0);
if (narcs > 0)
{
lw = pGC->lineWidth;
if (lw == 0)
{
lw = 1;
}
extra = lw / 2;
for (index = 0; index < narcs; index++)
{
box.x1 = (parcs[index].x - extra) + pDrawable->x;
box.y1 = (parcs[index].y - extra) + pDrawable->y;
box.x2 = box.x1 + parcs[index].width + lw;
box.y2 = box.y1 + parcs[index].height + lw;
rdpRegionUnionRect(&reg, &box);
}
}
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpPolyArc: cd %d", cd));
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)
{
rdpPolyArcPost(dev, clientCon, cd, &clip_reg, pDrawable, pGC,
narcs, parcs, &reg);
clientCon = clientCon->next;
}
rdpRegionUninit(&reg);
rdpRegionUninit(&clip_reg);
}

@ -32,13 +32,24 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "rdp.h"
#include "rdpDraw.h"
#include "rdpClientCon.h"
#include "rdpReg.h"
#define LOG_LEVEL 1
#define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
/******************************************************************************/
void
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)
{
GC_OP_VARS;
@ -48,11 +59,83 @@ 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;
int lw;
int extra;
RegionRec clip_reg;
RegionRec reg;
LLOGLN(0, ("rdpPolyFillArc:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolyFillArcCallCount++;
rdpRegionInit(&reg, NullBox, 0);
if (narcs > 0)
{
lw = pGC->lineWidth;
if (lw == 0)
{
lw = 1;
}
extra = lw / 2;
for (index = 0; index < narcs; index++)
{
box.x1 = (parcs[index].x - extra) + pDrawable->x;
box.y1 = (parcs[index].y - extra) + pDrawable->y;
box.x2 = box.x1 + parcs[index].width + lw;
box.y2 = box.y1 + parcs[index].height + lw;
rdpRegionUnionRect(&reg, &box);
}
}
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpPolyFillArc: cd %d", cd));
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
rdpPolyFillArcPre(dev, clientCon, cd, &clip_reg, pDrawable, pGC,
narcs, parcs, &reg);
clientCon = clientCon->next;
}
/* do original call */
rdpPolyFillArcOrg(pDrawable, pGC, narcs, parcs);
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
rdpPolyFillArcPost(dev, clientCon, cd, &clip_reg, pDrawable, pGC,
narcs, parcs, &reg);
clientCon = clientCon->next;
}
rdpRegionUninit(&reg);
rdpRegionUninit(&clip_reg);
}

@ -45,7 +45,7 @@ rdpPolyFillRectPre(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC,
int nrectFill, xRectangle *prectInit,
RegionPtr fill_reg)
RegionPtr reg)
{
}
@ -67,9 +67,9 @@ rdpPolyFillRectPost(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC,
int nrectFill, xRectangle *prectInit,
RegionPtr fill_reg)
RegionPtr reg)
{
if (cd == 0)
if (cd == XRDP_CD_NODRAW)
{
return;
}
@ -77,11 +77,11 @@ rdpPolyFillRectPost(rdpPtr dev, rdpClientCon *clientCon,
{
return;
}
if (cd == 2)
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(fill_reg, clip_reg, fill_reg);
rdpRegionIntersect(reg, clip_reg, reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, fill_reg);
rdpClientConAddDirtyScreenReg(dev, clientCon, reg);
}
/******************************************************************************/
@ -92,16 +92,15 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
rdpPtr dev;
rdpClientCon *clientCon;
RegionRec clip_reg;
RegionPtr fill_reg;
RegionPtr reg;
int cd;
LLOGLN(10, ("rdpPolyFillRect:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolyFillRectCallCount++;
/* make a copy of rects */
fill_reg = rdpRegionFromRects(nrectFill, prectInit, CT_NONE);
rdpRegionTranslate(fill_reg, pDrawable->x, pDrawable->y);
reg = rdpRegionFromRects(nrectFill, prectInit, CT_NONE);
rdpRegionTranslate(reg, pDrawable->x, pDrawable->y);
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpPolyFillRect: cd %d", cd));
@ -109,7 +108,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
while (clientCon != NULL)
{
rdpPolyFillRectPre(dev, clientCon, cd, &clip_reg, pDrawable,
pGC, nrectFill, prectInit, fill_reg);
pGC, nrectFill, prectInit, reg);
clientCon = clientCon->next;
}
/* do original call */
@ -118,9 +117,9 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
while (clientCon != NULL)
{
rdpPolyFillRectPost(dev, clientCon, cd, &clip_reg, pDrawable,
pGC, nrectFill, prectInit, fill_reg);
pGC, nrectFill, prectInit, reg);
clientCon = clientCon->next;
}
rdpRegionUninit(&clip_reg);
rdpRegionDestroy(fill_reg);
rdpRegionDestroy(reg);
}

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

@ -67,7 +67,7 @@ rdpPolyRectanglePost(rdpPtr dev, rdpClientCon *clientCon,
DrawablePtr pDrawable, GCPtr pGC, int nrects,
xRectangle *rects, RegionPtr reg)
{
if (cd == 0)
if (cd == XRDP_CD_NODRAW)
{
return;
}
@ -75,7 +75,7 @@ rdpPolyRectanglePost(rdpPtr dev, rdpClientCon *clientCon,
{
return;
}
if (cd == 2)
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(reg, clip_reg, reg);
}
@ -100,7 +100,7 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
LLOGLN(10, ("rdpPolyRectangle:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolyRectangleCallCount++;
rdpRegionInit(&reg, NullBox, 0);
lw = pGC->lineWidth;
if (lw < 1)
@ -161,4 +161,5 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
clientCon = clientCon->next;
}
rdpRegionUninit(&reg);
rdpRegionUninit(&clip_reg);
}

@ -40,7 +40,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
/******************************************************************************/
void
static void
rdpPolyText16Pre(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC,
@ -50,7 +50,7 @@ rdpPolyText16Pre(rdpPtr dev, rdpClientCon *clientCon,
}
/******************************************************************************/
int
static int
rdpPolyText16Org(DrawablePtr pDrawable, GCPtr pGC,
int x, int y, int count, unsigned short *chars)
{
@ -64,7 +64,7 @@ rdpPolyText16Org(DrawablePtr pDrawable, GCPtr pGC,
}
/******************************************************************************/
void
static void
rdpPolyText16Post(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC,
@ -73,7 +73,7 @@ rdpPolyText16Post(rdpPtr dev, rdpClientCon *clientCon,
{
RegionRec reg;
if (cd == 0)
if (cd == XRDP_CD_NODRAW)
{
return;
}
@ -82,12 +82,12 @@ rdpPolyText16Post(rdpPtr dev, rdpClientCon *clientCon,
return;
}
rdpRegionInit(&reg, box, 0);
if (cd == 2)
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
RegionUninit(&reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
@ -104,6 +104,7 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
LLOGLN(10, ("rdpPolyText16:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolyText16CallCount++;
GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box);
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
@ -124,6 +125,6 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
x, y, count, chars, &box);
clientCon = clientCon->next;
}
RegionUninit(&clip_reg);
rdpRegionUninit(&clip_reg);
return rv;
}

@ -40,7 +40,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
/******************************************************************************/
void
static void
rdpPolyText8Pre(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC,
@ -50,7 +50,7 @@ rdpPolyText8Pre(rdpPtr dev, rdpClientCon *clientCon,
}
/******************************************************************************/
int
static int
rdpPolyText8Org(DrawablePtr pDrawable, GCPtr pGC,
int x, int y, int count, char *chars)
{
@ -64,7 +64,7 @@ rdpPolyText8Org(DrawablePtr pDrawable, GCPtr pGC,
}
/******************************************************************************/
void
static void
rdpPolyText8Post(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC,
@ -73,7 +73,7 @@ rdpPolyText8Post(rdpPtr dev, rdpClientCon *clientCon,
{
RegionRec reg;
if (cd == 0)
if (cd == XRDP_CD_NODRAW)
{
return;
}
@ -82,12 +82,12 @@ rdpPolyText8Post(rdpPtr dev, rdpClientCon *clientCon,
return;
}
rdpRegionInit(&reg, box, 0);
if (cd == 2)
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
RegionUninit(&reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
@ -104,6 +104,7 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
LLOGLN(10, ("rdpPolyText8:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolyText8CallCount++;
GetTextBoundingBox(pDrawable, pGC->font, x, y, count, &box);
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
@ -124,6 +125,6 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
x, y, count, chars, &box);
clientCon = clientCon->next;
}
RegionUninit(&clip_reg);
rdpRegionUninit(&clip_reg);
return rv;
}

@ -68,20 +68,14 @@ rdpPutImagePost(rdpPtr dev, rdpClientCon *clientCon,
DrawablePtr pDst, GCPtr pGC, int depth, int x, int y,
int w, int h, int leftPad, int format, char *pBits)
{
WindowPtr pDstWnd;
BoxRec box;
RegionRec reg;
if (cd == 0)
if (cd == XRDP_CD_NODRAW)
{
return;
}
if (pDst->type != DRAWABLE_WINDOW)
{
return;
}
pDstWnd = (WindowPtr) pDst;
if (pDstWnd->viewable == FALSE)
if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDst))
{
return;
}
@ -90,12 +84,12 @@ rdpPutImagePost(rdpPtr dev, rdpClientCon *clientCon,
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
rdpRegionInit(&reg, &box, 0);
if (cd == 2)
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
RegionUninit(&reg);
rdpRegionUninit(&reg);
}
/******************************************************************************/
@ -110,6 +104,7 @@ rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y,
LLOGLN(10, ("rdpPutImage:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPutImageCallCount++;
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDst, pGC);
LLOGLN(10, ("rdpPutImage: cd %d", cd));
@ -130,5 +125,5 @@ rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y,
w, h, leftPad, format, pBits);
clientCon = clientCon->next;
}
RegionUninit(&clip_reg);
rdpRegionUninit(&clip_reg);
}

Loading…
Cancel
Save