xorg: work on xorg driver

ulab-next
Jay Sorg 11 years ago
parent f39ba98a4f
commit 03e5b5e62b

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

@ -105,8 +105,8 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
PictureScreenPtr ps;
BoxRec box;
LLOGLN(10, ("rdpComposite:"));
pScreen = pSrc->pDrawable->pScreen;
LLOGLN(0, ("rdpComposite:"));
pScreen = pDst->pDrawable->pScreen;
dev = rdpGetDevFromScreen(pScreen);
dev->counts.rdpCompositeCallCount++;
box.x1 = xDst + pDst->pDrawable->x;
@ -134,3 +134,96 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
clientCon = clientCon->next;
}
}
/******************************************************************************/
static void
rdpTrapezoidsPre(rdpPtr dev, rdpClientCon *clientCon, PictureScreenPtr ps,
CARD8 op, PicturePtr pSrc, PicturePtr pDst,
PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
int ntrap, xTrapezoid *traps, BoxPtr box)
{
}
/******************************************************************************/
static void
rdpTrapezoidsOrg(PictureScreenPtr ps, rdpPtr dev,
CARD8 op, PicturePtr pSrc, PicturePtr pDst,
PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
int ntrap, xTrapezoid *traps)
{
ps->Trapezoids = dev->Trapezoids;
ps->Trapezoids(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, traps);
ps->Trapezoids = rdpTrapezoids;
}
/******************************************************************************/
static void
rdpTrapezoidsPost(rdpPtr dev, rdpClientCon *clientCon, PictureScreenPtr ps,
CARD8 op, PicturePtr pSrc, PicturePtr pDst,
PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
int ntrap, xTrapezoid *traps, BoxPtr box)
{
RegionRec reg;
if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDst->pDrawable))
{
return;
}
rdpRegionInit(&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,
PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
int ntrap, xTrapezoid *traps)
{
ScreenPtr pScreen;
rdpPtr dev;
rdpClientCon *clientCon;
PictureScreenPtr ps;
BoxRec box;
RegionRec reg;
int index;
LLOGLN(0, ("rdpTrapezoids:"));
pScreen = pDst->pDrawable->pScreen;
dev = rdpGetDevFromScreen(pScreen);
dev->counts.rdpTrapezoidsCallCount++;
rdpRegionInit(&reg, NullBox, 0);
for (index = 0; index < ntrap; index++)
{
LLOGLN(0, (" top %d bottom %d left p1 %d %d",
traps[index].top, traps[index].bottom,
traps[index].left.p1.x, traps[index].left.p1.y));
//box.x1 = traps[index].left + pDst->pDrawable->x;
//box.y1 = traps[index].top + pDst->pDrawable->y;
//box.x2 = traps[index].right + pDst->pDrawable->x;
//box.y2 = traps[index].bottom + pDst->pDrawable->y;
}
ps = GetPictureScreen(pScreen);
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
//rdpTrapezoidsPre(dev, clientCon, ps, op, pSrc, pDst,
// maskFormat, xSrc, ySrc, ntrap, traps, &box);
clientCon = clientCon->next;
}
/* do original call */
rdpTrapezoidsOrg(ps, dev, op, pSrc, pDst, maskFormat, xSrc, ySrc,
ntrap, traps);
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
//rdpTrapezoidsPost(dev, clientCon, ps, op, pSrc, pDst,
// maskFormat, xSrc, ySrc, ntrap, traps, &box);
clientCon = clientCon->next;
}
}

@ -28,5 +28,9 @@ void
rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst,
INT16 yDst, CARD16 width, CARD16 height);
void
rdpTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc,
int ntrap, xTrapezoid *traps);
#endif

@ -44,7 +44,8 @@ static void
rdpCopyAreaPre(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
int srcx, int srcy, int w, int h, int dstx, int dsty)
int srcx, int srcy, int w, int h, int dstx, int dsty,
RegionPtr reg)
{
}
@ -67,10 +68,9 @@ static void
rdpCopyAreaPost(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
int srcx, int srcy, int w, int h, int dstx, int dsty)
int srcx, int srcy, int w, int h, int dstx, int dsty,
RegionPtr reg)
{
BoxRec box;
RegionRec reg;
if (cd == XRDP_CD_NODRAW)
{
@ -80,17 +80,7 @@ rdpCopyAreaPost(rdpPtr dev, rdpClientCon *clientCon,
{
return;
}
box.x1 = dstx + pDst->x;
box.y1 = dsty + pDst->y;
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
rdpRegionInit(&reg, &box, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, clip_reg, &reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &reg);
rdpRegionUninit(&reg);
rdpClientConAddDirtyScreenReg(dev, clientCon, reg);
}
/******************************************************************************/
@ -103,6 +93,8 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
RegionPtr rv;
RegionRec clip_reg;
int cd;
BoxRec box;
RegionRec reg;
LLOGLN(10, ("rdpCopyArea:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
@ -110,11 +102,20 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDst, pGC);
LLOGLN(10, ("rdpCopyArea: cd %d", cd));
box.x1 = dstx + pDst->x;
box.y1 = dsty + pDst->y;
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
rdpRegionInit(&reg, &box, 0);
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);
srcx, srcy, w, h, dstx, dsty, &reg);
clientCon = clientCon->next;
}
/* do original call */
@ -123,9 +124,10 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
while (clientCon != NULL)
{
rdpCopyAreaPost(dev, clientCon, cd, &clip_reg, pSrc, pDst, pGC,
srcx, srcy, w, h, dstx, dsty);
srcx, srcy, w, h, dstx, dsty, &reg);
clientCon = clientCon->next;
}
rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
return rv;
}

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

@ -74,10 +74,6 @@ rdpPolyArcPost(rdpPtr dev, rdpClientCon *clientCon,
{
return;
}
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(reg, clip_reg, reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, reg);
}
@ -95,7 +91,7 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
RegionRec clip_reg;
RegionRec reg;
LLOGLN(10, ("rdpPolyArc:"));
LLOGLN(0, ("rdpPolyArc:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolyArcCallCount++;
rdpRegionInit(&reg, NullBox, 0);
@ -119,6 +115,10 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpPolyArc: cd %d", cd));
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&reg, &clip_reg, &reg);
}
clientCon = dev->clientConHead;
while (clientCon != NULL)
{

@ -77,10 +77,6 @@ rdpPolyFillRectPost(rdpPtr dev, rdpClientCon *clientCon,
{
return;
}
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(reg, clip_reg, reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, reg);
}
@ -103,6 +99,10 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
rdpRegionTranslate(reg, pDrawable->x, pDrawable->y);
rdpRegionInit(&clip_reg, NullBox, 0);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(reg, &clip_reg, reg);
}
LLOGLN(10, ("rdpPolyFillRect: cd %d", cd));
clientCon = dev->clientConHead;
while (clientCon != NULL)

@ -67,6 +67,8 @@ rdpPolyPointPost(rdpPtr dev, rdpClientCon *clientCon,
DrawablePtr pDrawable, GCPtr pGC, int mode,
int npt, DDXPointPtr in_pts, RegionPtr reg)
{
RegionRec lreg;
if (cd == XRDP_CD_NODRAW)
{
return;
@ -75,11 +77,13 @@ rdpPolyPointPost(rdpPtr dev, rdpClientCon *clientCon,
{
return;
}
rdpRegionInit(&lreg, NullBox, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(reg, clip_reg, reg);
rdpRegionIntersect(&lreg, clip_reg, reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, reg);
rdpClientConAddDirtyScreenReg(dev, clientCon, &lreg);
rdpRegionUninit(&lreg);
}
/******************************************************************************/
@ -92,18 +96,24 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
RegionRec clip_reg;
RegionRec reg;
int cd;
int index;
BoxRec box;
LLOGLN(0, ("rdpPolyPoint:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolyPointCallCount++;
rdpRegionInit(&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);
cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpPolyPoint: cd %d", cd));
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
@ -111,10 +121,8 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
pGC, mode, npt, in_pts, &reg);
clientCon = clientCon->next;
}
/* do original call */
rdpPolyPointOrg(pDrawable, pGC, mode, npt, in_pts);
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
@ -122,7 +130,6 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
pGC, mode, npt, in_pts, &reg);
clientCon = clientCon->next;
}
rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
}

@ -32,11 +32,22 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "rdp.h"
#include "rdpDraw.h"
#include "rdpClientCon.h"
#include "rdpReg.h"
#define LOG_LEVEL 1
#define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
/******************************************************************************/
void
rdpPolySegmentPre(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC, int nseg,
xSegment *pSegs, RegionPtr reg)
{
}
/******************************************************************************/
void
rdpPolySegmentOrg(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs)
@ -48,11 +59,85 @@ rdpPolySegmentOrg(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs)
GC_OP_EPILOGUE(pGC);
}
/******************************************************************************/
void
rdpPolySegmentPost(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC, int nseg,
xSegment *pSegs, RegionPtr reg)
{
RegionRec lreg;
if (cd == XRDP_CD_NODRAW)
{
return;
}
if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable))
{
return;
}
rdpRegionInit(&lreg, NullBox, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&lreg, clip_reg, reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &lreg);
rdpRegionUninit(&lreg);
}
/******************************************************************************/
void
rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs)
{
LLOGLN(0, ("rdpPolySegment:"));
rdpPtr dev;
rdpClientCon *clientCon;
RegionRec clip_reg;
RegionRec reg;
int cd;
int index;
int x1;
int y1;
int x2;
int y2;
BoxRec box;
LLOGLN(10, ("rdpPolySegment:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolySegmentCallCount++;
rdpRegionInit(&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));
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
rdpPolySegmentPre(dev, clientCon, cd, &clip_reg, pDrawable,
pGC, nseg, pSegs, &reg);
clientCon = clientCon->next;
}
/* do original call */
rdpPolySegmentOrg(pDrawable, pGC, nseg, pSegs);
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
rdpPolySegmentPost(dev, clientCon, cd, &clip_reg, pDrawable,
pGC, nseg, pSegs, &reg);
clientCon = clientCon->next;
}
rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
}

@ -32,11 +32,22 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "rdp.h"
#include "rdpDraw.h"
#include "rdpClientCon.h"
#include "rdpReg.h"
#define LOG_LEVEL 1
#define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
/******************************************************************************/
void
rdpPolylinesPre(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC, int mode,
int npt, DDXPointPtr pptInit, RegionPtr reg)
{
}
/******************************************************************************/
static void
rdpPolylinesOrg(DrawablePtr pDrawable, GCPtr pGC, int mode,
@ -49,12 +60,84 @@ rdpPolylinesOrg(DrawablePtr pDrawable, GCPtr pGC, int mode,
GC_OP_EPILOGUE(pGC);
}
/******************************************************************************/
void
rdpPolylinesPost(rdpPtr dev, rdpClientCon *clientCon,
int cd, RegionPtr clip_reg,
DrawablePtr pDrawable, GCPtr pGC, int mode,
int npt, DDXPointPtr pptInit, RegionPtr reg)
{
RegionRec lreg;
if (cd == XRDP_CD_NODRAW)
{
return;
}
if (!XRDP_DRAWABLE_IS_VISIBLE(dev, pDrawable))
{
return;
}
rdpRegionInit(&lreg, NullBox, 0);
if (cd == XRDP_CD_CLIP)
{
rdpRegionIntersect(&lreg, clip_reg, reg);
}
rdpClientConAddDirtyScreenReg(dev, clientCon, &lreg);
rdpRegionUninit(&lreg);
}
/******************************************************************************/
void
rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode,
int npt, DDXPointPtr pptInit)
{
LLOGLN(0, ("rdpPolylines:"));
rdpPtr dev;
rdpClientCon *clientCon;
RegionRec clip_reg;
RegionRec reg;
int cd;
int index;
int x1;
int y1;
int x2;
int y2;
BoxRec box;
LLOGLN(10, ("rdpPolylines:"));
dev = rdpGetDevFromScreen(pGC->pScreen);
dev->counts.rdpPolylinesCallCount++;
rdpRegionInit(&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));
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
rdpPolylinesPre(dev, clientCon, cd, &clip_reg, pDrawable,
pGC, mode, npt, pptInit, &reg);
clientCon = clientCon->next;
}
/* do original call */
rdpPolylinesOrg(pDrawable, pGC, mode, npt, pptInit);
clientCon = dev->clientConHead;
while (clientCon != NULL)
{
rdpPolylinesPost(dev, clientCon, cd, &clip_reg, pDrawable,
pGC, mode, npt, pptInit, &reg);
clientCon = clientCon->next;
}
rdpRegionUninit(&clip_reg);
rdpRegionUninit(&reg);
}

@ -531,6 +531,9 @@ rdpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
/* glyphs */
dev->Glyphs = ps->Glyphs;
ps->Glyphs = rdpGlyphs;
dev->Trapezoids = ps->Trapezoids;
ps->Trapezoids = rdpTrapezoids;
}
RegisterBlockAndWakeupHandlers(rdpBlockHandler1, rdpWakeupHandler1, pScreen);

Loading…
Cancel
Save