void rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *prectInit) { rdpPtr dev; RegionRec clip_reg; RegionPtr reg; int cd; LLOGLN(10, ("rdpPolyFillRect:")); dev = rdpGetDevFromScreen(pGC->pScreen); dev->counts.rdpPolyFillRectCallCount++; /* make a copy of rects */ 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)); if (cd == XRDP_CD_CLIP) { rdpRegionIntersect(reg, &clip_reg, reg); } /* do original call */ rdpPolyFillRectOrg(pDrawable, pGC, nrectFill, prectInit); if (cd != XRDP_CD_NODRAW) { rdpClientConAddAllReg(dev, reg, pDrawable); } rdpRegionUninit(&clip_reg); rdpRegionDestroy(reg); }
void rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) { ScreenPtr pScreen; rdpPtr dev; RegionRec reg; RegionRec clip; int dx; int dy; 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++; rdpRegionInit(®, NullBox, 0); rdpRegionCopy(®, pOldRegion); rdpRegionInit(&clip, NullBox, 0); rdpRegionCopy(&clip, &pWin->borderClip); dx = pWin->drawable.x - ptOldOrg.x; dy = pWin->drawable.y - ptOldOrg.y; dev->pScreen->CopyWindow = dev->CopyWindow; dev->pScreen->CopyWindow(pWin, ptOldOrg, pOldRegion); dev->pScreen->CopyWindow = rdpCopyWindow; num_clip_rects = REGION_NUM_RECTS(&clip); num_reg_rects = REGION_NUM_RECTS(®); if ((num_clip_rects == 0) || (num_reg_rects == 0)) { } else { if ((num_clip_rects > 16) || (num_reg_rects > 16)) { LLOGLN(10, ("rdpCopyWindow: big list")); box = rdpRegionExtents(®); box1 = *box; box1.x1 += dx; box1.y1 += dy; box1.x2 += dx; box1.y2 += dy; rdpClientConAddAllBox(dev, &box1, &(pWin->drawable)); } else { rdpRegionTranslate(®, dx, dy); rdpRegionIntersect(®, ®, &clip); rdpClientConAddAllReg(dev, ®, &(pWin->drawable)); } } rdpRegionUninit(®); rdpRegionUninit(&clip); }
/* return 2, draw using clip */ int rdpDrawGetClip(rdpPtr dev, RegionPtr pRegion, DrawablePtr pDrawable, GCPtr pGC) { WindowPtr pWindow; RegionPtr temp; BoxRec box; int rv; rv = 0; if (pDrawable->type == DRAWABLE_PIXMAP) { if (is_clientClip_region(pGC)) { miComputeCompositeClip(pGC, pDrawable); RegionCopy(pRegion, pGC->pCompositeClip); rv = 2; } else { rv = 1; } if (rv == 2) /* check if the clip is the entire pixmap */ { box.x1 = 0; box.y1 = 0; box.x2 = pDrawable->width; box.y2 = pDrawable->height; if (rdpRegionContainsRect(pRegion, &box) == rgnIN) { rv = 1; } } } else if (pDrawable->type == DRAWABLE_WINDOW) { pWindow = (WindowPtr)pDrawable; if (pWindow->viewable) { if (pGC->subWindowMode == IncludeInferiors) { temp = &pWindow->borderClip; } else { temp = &pWindow->clipList; } if (rdpRegionNotEmpty(temp)) { if (is_clientClip_region(pGC)) { rdpRegionCopy(pRegion, pGC->clientClip); rdpRegionTranslate(pRegion, pDrawable->x + pGC->clipOrg.x, pDrawable->y + pGC->clipOrg.y); rdpRegionIntersect(pRegion, pRegion, temp); rv = 2; } else { rdpRegionCopy(pRegion, temp); rv = 2; } if (rv == 2) /* check if the clip is the entire screen */ { box.x1 = 0; box.y1 = 0; box.x2 = dev->width; box.y2 = dev->height; if (rdpRegionContainsRect(pRegion, &box) == rgnIN) { rv = 1; } } } } } return rv; }
/* return 2, draw using clip */ int rdpDrawGetClip(rdpPtr dev, RegionPtr pRegion, DrawablePtr pDrawable, GCPtr pGC) { WindowPtr pWindow; RegionPtr temp; BoxRec box; int rv; rv = 0; if (pDrawable->type == DRAWABLE_PIXMAP) { switch (pGC->clientClipType) { case CT_NONE: rv = 1; break; case CT_REGION: rv = 2; rdpRegionCopy(pRegion, pGC->clientClip); break; default: LLOGLN(0, ("rdpDrawGetClip: unimp clip type %d", pGC->clientClipType)); break; } if (rv == 2) /* check if the clip is the entire pixmap */ { box.x1 = 0; box.y1 = 0; box.x2 = pDrawable->width; box.y2 = pDrawable->height; if (rdpRegionContainsRect(pRegion, &box) == rgnIN) { rv = 1; } } } else if (pDrawable->type == DRAWABLE_WINDOW) { pWindow = (WindowPtr)pDrawable; if (pWindow->viewable) { if (pGC->subWindowMode == IncludeInferiors) { temp = &pWindow->borderClip; } else { temp = &pWindow->clipList; } if (rdpRegionNotEmpty(temp)) { switch (pGC->clientClipType) { case CT_NONE: rv = 2; rdpRegionCopy(pRegion, temp); break; case CT_REGION: rv = 2; rdpRegionCopy(pRegion, pGC->clientClip); rdpRegionTranslate(pRegion, pDrawable->x + pGC->clipOrg.x, pDrawable->y + pGC->clipOrg.y); rdpRegionIntersect(pRegion, pRegion, temp); break; default: LLOGLN(0, ("rdpDrawGetClip: unimp clip type %d", pGC->clientClipType)); break; } if (rv == 2) /* check if the clip is the entire screen */ { box.x1 = 0; box.y1 = 0; box.x2 = dev->width; box.y2 = dev->height; if (rdpRegionContainsRect(pRegion, &box) == rgnIN) { rv = 1; } } } } } return rv; }