Ejemplo n.º 1
0
void
rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs)
{
    rdpPtr dev;
    RegionRec clip_reg;
    RegionRec reg;
    int cd;
    int index;
    int x1;
    int y1;
    int x2;
    int y2;
    BoxRec box;

    LLOGLN(10, ("rdpPolySegment:"));
    dev = rdpGetDevFromScreen(pGC->pScreen);
    dev->counts.rdpPolySegmentCallCount++;
    rdpRegionInit(&reg, NullBox, 0);
    for (index = 0; index < nseg; index++)
    {
        x1 = pSegs[index].x1 + pDrawable->x;
        y1 = pSegs[index].y1 + pDrawable->y;
        x2 = pSegs[index].x2 + pDrawable->x;
        y2 = pSegs[index].y2 + pDrawable->y;
        box.x1 = RDPMIN(x1, x2);
        box.y1 = RDPMIN(y1, y2);
        box.x2 = RDPMAX(x1, x2) + 1;
        box.y2 = RDPMAX(y1, y2) + 1;
        rdpRegionUnionRect(&reg, &box);
    }
    rdpRegionInit(&clip_reg, NullBox, 0);
    cd = rdpDrawGetClip(dev, &clip_reg, pDrawable, pGC);
    LLOGLN(10, ("rdpPolySegment: cd %d", cd));
    if (cd == XRDP_CD_CLIP)
    {
        rdpRegionIntersect(&reg, &clip_reg, &reg);
    }
    /* do original call */
    rdpPolySegmentOrg(pDrawable, pGC, nseg, pSegs);
    if (cd != XRDP_CD_NODRAW)
    {
        rdpClientConAddAllReg(dev, &reg, pDrawable);
    }
    rdpRegionUninit(&clip_reg);
    rdpRegionUninit(&reg);
}
Ejemplo n.º 2
0
void
rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
             int npt, DDXPointPtr in_pts)
{
    rdpPtr dev;
    RegionRec clip_reg;
    RegionRec reg;
    int cd;
    int index;
    BoxRec box;

    LLOGLN(10, ("rdpPolyPoint:"));
    dev = rdpGetDevFromScreen(pGC->pScreen);
    dev->counts.rdpPolyPointCallCount++;
    rdpRegionInit(&reg, NullBox, 0);
    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));
    if (cd == XRDP_CD_CLIP)
    {
        rdpRegionIntersect(&reg, &clip_reg, &reg);
    }
    /* do original call */
    rdpPolyPointOrg(pDrawable, pGC, mode, npt, in_pts);
    if (cd != XRDP_CD_NODRAW)
    {
        rdpClientConAddAllReg(dev, &reg, pDrawable);
    }
    rdpRegionUninit(&clip_reg);
    rdpRegionUninit(&reg);
}
Ejemplo n.º 3
0
void
rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
                 xRectangle *rects)
{
    rdpPtr dev;
    BoxRec box;
    int index;
    int up;
    int down;
    int lw;
    int cd;
    int x1;
    int y1;
    int x2;
    int y2;
    RegionRec clip_reg;
    RegionRec reg;

    LLOGLN(10, ("rdpPolyRectangle:"));
    dev = rdpGetDevFromScreen(pGC->pScreen);
    dev->counts.rdpPolyRectangleCallCount++;
    rdpRegionInit(&reg, NullBox, 0);
    lw = pGC->lineWidth;
    if (lw < 1)
    {
        lw = 1;
    }
    up = lw / 2;
    down = 1 + (lw - 1) / 2;
    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));
    if (cd == XRDP_CD_CLIP)
    {
        rdpRegionIntersect(&reg, &clip_reg, &reg);
    }
    /* do original call */
    rdpPolyRectangleOrg(pDrawable, pGC, nrects, rects);
    if (cd != XRDP_CD_NODRAW)
    {
        rdpClientConAddAllReg(dev, &reg, pDrawable);
    }
    rdpRegionUninit(&clip_reg);
    rdpRegionUninit(&reg);
}