本文整理汇总了C++中RegionUninit函数的典型用法代码示例。如果您正苦于以下问题:C++ RegionUninit函数的具体用法?C++ RegionUninit怎么用?C++ RegionUninit使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RegionUninit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exaDestroyPixmap_classic
Bool
exaDestroyPixmap_classic(PixmapPtr pPixmap)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
ExaScreenPriv(pScreen);
Bool ret;
if (pPixmap->refcnt == 1) {
ExaPixmapPriv(pPixmap);
exaDestroyPixmap(pPixmap);
if (pExaPixmap->area) {
DBG_PIXMAP(("-- 0x%p (0x%x) (%dx%d)\n",
(void *) pPixmap->drawable.id,
ExaGetPixmapPriv(pPixmap)->area->offset,
pPixmap->drawable.width, pPixmap->drawable.height));
/* Free the offscreen area */
exaOffscreenFree(pPixmap->drawable.pScreen, pExaPixmap->area);
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
pPixmap->devKind = pExaPixmap->sys_pitch;
}
RegionUninit(&pExaPixmap->validSys);
RegionUninit(&pExaPixmap->validFB);
}
swap(pExaScr, pScreen, DestroyPixmap);
ret = pScreen->DestroyPixmap(pPixmap);
swap(pExaScr, pScreen, DestroyPixmap);
return ret;
}
示例2: ShadowCopyWindow
static void
ShadowCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgn)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen);
int num = 0;
RegionRec rgnDst;
if (pPriv->vtSema) {
RegionNull(&rgnDst);
RegionCopy(&rgnDst, prgn);
RegionTranslate(&rgnDst,
pWin->drawable.x - ptOldOrg.x,
pWin->drawable.y - ptOldOrg.y);
RegionIntersect(&rgnDst, &pWin->borderClip, &rgnDst);
if ((num = RegionNumRects(&rgnDst))) {
if (pPriv->preRefresh)
(*pPriv->preRefresh) (pPriv->pScrn, num, RegionRects(&rgnDst));
}
else {
RegionUninit(&rgnDst);
}
}
pScreen->CopyWindow = pPriv->CopyWindow;
(*pScreen->CopyWindow) (pWin, ptOldOrg, prgn);
pScreen->CopyWindow = ShadowCopyWindow;
if (num) {
if (pPriv->postRefresh)
(*pPriv->postRefresh) (pPriv->pScrn, num, RegionRects(&rgnDst));
RegionUninit(&rgnDst);
}
}
示例3: miHandleValidateExposures
/*****
* miHandleValidateExposures(pWin)
* starting at pWin, draw background in any windows that have exposure
* regions, translate the regions, restore any backing store,
* and then send any regions still exposed to the client
*****/
void
miHandleValidateExposures(WindowPtr pWin)
{
WindowPtr pChild;
ValidatePtr val;
WindowExposuresProcPtr WindowExposures;
pChild = pWin;
WindowExposures = pChild->drawable.pScreen->WindowExposures;
while (1) {
if ((val = pChild->valdata)) {
if (RegionNotEmpty(&val->after.borderExposed))
miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER);
RegionUninit(&val->after.borderExposed);
(*WindowExposures) (pChild, &val->after.exposed, NullRegion);
RegionUninit(&val->after.exposed);
free(val);
pChild->valdata = NULL;
if (pChild->firstChild) {
pChild = pChild->firstChild;
continue;
}
}
while (!pChild->nextSib && (pChild != pWin))
pChild = pChild->parent;
if (pChild == pWin)
break;
pChild = pChild->nextSib;
}
}
示例4: XAACopyWindow
void
XAACopyWindow(
WindowPtr pWin,
DDXPointRec ptOldOrg,
RegionPtr prgnSrc )
{
DDXPointPtr pptSrc, ppt;
RegionRec rgnDst;
BoxPtr pbox;
int dx, dy, nbox;
WindowPtr pwinRoot;
ScreenPtr pScreen = pWin->drawable.pScreen;
XAAInfoRecPtr infoRec =
GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable));
if (!infoRec->pScrn->vtSema || !infoRec->ScreenToScreenBitBlt) {
XAA_SCREEN_PROLOGUE (pScreen, CopyWindow);
if(infoRec->pScrn->vtSema && infoRec->NeedToSync) {
(*infoRec->Sync)(infoRec->pScrn);
infoRec->NeedToSync = FALSE;
}
(*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
XAA_SCREEN_EPILOGUE (pScreen, CopyWindow, XAACopyWindow);
return;
}
pwinRoot = pScreen->root;
RegionNull(&rgnDst);
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
RegionTranslate(prgnSrc, -dx, -dy);
RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc);
pbox = RegionRects(&rgnDst);
nbox = RegionNumRects(&rgnDst);
if(!nbox ||
!(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) {
RegionUninit(&rgnDst);
return;
}
ppt = pptSrc;
while(nbox--) {
ppt->x = pbox->x1 + dx;
ppt->y = pbox->y1 + dy;
ppt++; pbox++;
}
infoRec->ScratchGC.planemask = ~0L;
infoRec->ScratchGC.alu = GXcopy;
XAADoBitBlt((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
&(infoRec->ScratchGC), &rgnDst, pptSrc);
free(pptSrc);
RegionUninit(&rgnDst);
}
示例5: ExaCheckCopyNtoN
void
ExaCheckCopyNtoN(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
BoxPtr pbox, int nbox, int dx, int dy, Bool reverse,
Bool upsidedown, Pixel bitplane, void *closure)
{
RegionRec reg;
int xoff, yoff;
EXA_PRE_FALLBACK_GC(pGC);
EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrc, pDst,
exaDrawableLocation(pSrc), exaDrawableLocation(pDst)));
if (pExaScr->prepare_access_reg && RegionInitBoxes(®, pbox, nbox)) {
PixmapPtr pPixmap = exaGetDrawablePixmap(pSrc);
exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff);
RegionTranslate(®, xoff + dx, yoff + dy);
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, ®);
RegionUninit(®);
}
else
exaPrepareAccess(pSrc, EXA_PREPARE_SRC);
if (pExaScr->prepare_access_reg &&
!exaGCReadsDestination(pDst, pGC->planemask, pGC->fillStyle,
pGC->alu, pGC->clientClipType) &&
RegionInitBoxes(®, pbox, nbox)) {
PixmapPtr pPixmap = exaGetDrawablePixmap(pDst);
exaGetDrawableDeltas(pDst, pPixmap, &xoff, &yoff);
RegionTranslate(®, xoff, yoff);
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST, ®);
RegionUninit(®);
}
else
exaPrepareAccess(pDst, EXA_PREPARE_DEST);
/* This will eventually call fbCopyNtoN, with some calculation overhead. */
while (nbox--) {
pGC->ops->CopyArea(pSrc, pDst, pGC, pbox->x1 - pSrc->x + dx,
pbox->y1 - pSrc->y + dy, pbox->x2 - pbox->x1,
pbox->y2 - pbox->y1, pbox->x1 - pDst->x,
pbox->y1 - pDst->y);
pbox++;
}
exaFinishAccess(pSrc, EXA_PREPARE_SRC);
exaFinishAccess(pDst, EXA_PREPARE_DEST);
EXA_POST_FALLBACK_GC(pGC);
}
示例6: compAllocPixmap
Bool
compAllocPixmap(WindowPtr pWin)
{
int bw = (int) pWin->borderWidth;
int x = pWin->drawable.x - bw;
int y = pWin->drawable.y - bw;
int w = pWin->drawable.width + (bw << 1);
int h = pWin->drawable.height + (bw << 1);
PixmapPtr pPixmap = compNewPixmap(pWin, x, y, w, h);
CompWindowPtr cw = GetCompWindow(pWin);
if (!pPixmap)
return FALSE;
if (cw->update == CompositeRedirectAutomatic)
pWin->redirectDraw = RedirectDrawAutomatic;
else
pWin->redirectDraw = RedirectDrawManual;
compSetPixmap(pWin, pPixmap);
cw->oldx = COMP_ORIGIN_INVALID;
cw->oldy = COMP_ORIGIN_INVALID;
cw->damageRegistered = FALSE;
if (cw->update == CompositeRedirectAutomatic) {
DamageRegister(&pWin->drawable, cw->damage);
cw->damageRegistered = TRUE;
}
/* Make sure our borderClip is up to date */
RegionUninit(&cw->borderClip);
RegionCopy(&cw->borderClip, &pWin->borderClip);
cw->borderClipX = pWin->drawable.x;
cw->borderClipY = pWin->drawable.y;
return TRUE;
}
示例7: ExaFallbackPrepareReg
static void
ExaFallbackPrepareReg(DrawablePtr pDrawable,
GCPtr pGC,
int x, int y, int width, int height,
int index, Bool checkReads)
{
ScreenPtr pScreen = pDrawable->pScreen;
ExaScreenPriv(pScreen);
if (pExaScr->prepare_access_reg &&
!(checkReads && exaGCReadsDestination(pDrawable,
pGC->planemask,
pGC->fillStyle,
pGC->alu, pGC->clientClipType))) {
BoxRec box;
RegionRec reg;
int xoff, yoff;
PixmapPtr pPixmap = exaGetDrawablePixmap(pDrawable);
exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff);
box.x1 = pDrawable->x + x + xoff;
box.y1 = pDrawable->y + y + yoff;
box.x2 = box.x1 + width;
box.y2 = box.y1 + height;
RegionInit(®, &box, 1);
pExaScr->prepare_access_reg(pPixmap, index, ®);
RegionUninit(®);
}
else
exaPrepareAccess(pDrawable, index);
}
示例8: rdpCopyAreaWndToPixmap
static RegionPtr
rdpCopyAreaWndToPixmap(WindowPtr pSrcWnd,
PixmapPtr pDstPixmap, rdpPixmapRec *pDstPriv,
GCPtr pGC, int srcx, int srcy, int w, int h,
int dstx, int dsty)
{
int cd;
int lsrcx;
int lsrcy;
int ldstx;
int ldsty;
int num_clips;
int j;
BoxRec box;
RegionPtr rv;
RegionRec clip_reg;
LLOGLN(10, ("rdpCopyAreaWndToPixmap:"));
RegionInit(&clip_reg, NullBox, 0);
cd = rdp_get_clip(&clip_reg, &(pDstPixmap->drawable), pGC);
lsrcx = pSrcWnd->drawable.x + srcx;
lsrcy = pSrcWnd->drawable.y + srcy;
ldstx = pDstPixmap->drawable.x + dstx;
ldsty = pDstPixmap->drawable.y + dsty;
if (cd == 1)
{
rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_begin_update();
rdpup_screen_blt(ldstx, ldsty, w, h, lsrcx, lsrcy);
rdpup_end_update();
rdpup_switch_os_surface(-1);
}
else if (cd == 2)
{
num_clips = REGION_NUM_RECTS(&clip_reg);
if (num_clips > 0)
{
rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_begin_update();
for (j = 0; j < num_clips; j++)
{
box = REGION_RECTS(&clip_reg)[j];
rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
rdpup_screen_blt(ldstx, ldsty, w, h, lsrcx, lsrcy);
}
rdpup_reset_clip();
rdpup_end_update();
rdpup_switch_os_surface(-1);
}
}
RegionUninit(&clip_reg);
rv = rdpCopyAreaOrg(&(pSrcWnd->drawable), &(pDstPixmap->drawable),
pGC, srcx, srcy, w, h, dstx, dsty);
return rv;
}
示例9: miWindowExposures
void
miWindowExposures(WindowPtr pWin, RegionPtr prgn)
{
RegionPtr exposures = prgn;
if (prgn && !RegionNil(prgn)) {
RegionRec expRec;
int clientInterested =
(pWin->eventMask | wOtherEventMasks(pWin)) & ExposureMask;
if (clientInterested && (RegionNumRects(prgn) > RECTLIMIT)) {
/*
* If we have LOTS of rectangles, we decide to take the extents
* and force an exposure on that. This should require much less
* work overall, on both client and server. This is cheating, but
* isn't prohibited by the protocol ("spontaneous combustion" :-).
*/
BoxRec box = *RegionExtents(prgn);
exposures = &expRec;
RegionInit(exposures, &box, 1);
RegionReset(prgn, &box);
/* miPaintWindow doesn't clip, so we have to */
RegionIntersect(prgn, prgn, &pWin->clipList);
}
pWin->drawable.pScreen->PaintWindow(pWin, prgn, PW_BACKGROUND);
if (clientInterested)
miSendExposures(pWin, exposures,
pWin->drawable.x, pWin->drawable.y);
if (exposures == &expRec)
RegionUninit(exposures);
RegionEmpty(prgn);
}
}
示例10: rdpRestoreAreas
RegionPtr
rdpRestoreAreas(WindowPtr pWin, RegionPtr prgnExposed)
{
RegionRec reg;
RegionPtr rv;
int j;
BoxRec box;
LLOGLN(0, ("in rdpRestoreAreas"));
RegionInit(®, NullBox, 0);
RegionCopy(®, prgnExposed);
g_pScreen->RestoreAreas = g_rdpScreen.RestoreAreas;
rv = g_pScreen->RestoreAreas(pWin, prgnExposed);
if (g_do_dirty_ons)
{
draw_item_add_img_region(&g_screenPriv, ®, GXcopy, RDI_IMGLL);
}
else
{
rdpup_begin_update();
for (j = REGION_NUM_RECTS(®) - 1; j >= 0; j--)
{
box = REGION_RECTS(®)[j];
rdpup_send_area(0, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
}
rdpup_end_update();
}
RegionUninit(®);
g_pScreen->RestoreAreas = rdpRestoreAreas;
return rv;
}
示例11: xf86CrtcDamageShadow
static void
xf86CrtcDamageShadow(xf86CrtcPtr crtc)
{
ScrnInfoPtr pScrn = crtc->scrn;
BoxRec damage_box;
RegionRec damage_region;
ScreenPtr pScreen = xf86ScrnToScreen(pScrn);
damage_box.x1 = 0;
damage_box.x2 = crtc->mode.HDisplay;
damage_box.y1 = 0;
damage_box.y2 = crtc->mode.VDisplay;
if (!pixman_transform_bounds(&crtc->crtc_to_framebuffer, &damage_box)) {
damage_box.x1 = 0;
damage_box.y1 = 0;
damage_box.x2 = pScreen->width;
damage_box.y2 = pScreen->height;
}
if (damage_box.x1 < 0)
damage_box.x1 = 0;
if (damage_box.y1 < 0)
damage_box.y1 = 0;
if (damage_box.x2 > pScreen->width)
damage_box.x2 = pScreen->width;
if (damage_box.y2 > pScreen->height)
damage_box.y2 = pScreen->height;
RegionInit(&damage_region, &damage_box, 1);
DamageDamageRegion(&(*pScreen->GetScreenPixmap) (pScreen)->drawable,
&damage_region);
RegionUninit(&damage_region);
crtc->shadowClear = TRUE;
}
示例12: fbCopyWindow
void
fbCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{
RegionRec rgnDst;
int dx, dy;
PixmapPtr pPixmap = fbGetWindowPixmap(pWin);
DrawablePtr pDrawable = &pPixmap->drawable;
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
RegionTranslate(prgnSrc, -dx, -dy);
RegionNull(&rgnDst);
RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc);
#ifdef COMPOSITE
if (pPixmap->screen_x || pPixmap->screen_y)
RegionTranslate(&rgnDst, -pPixmap->screen_x, -pPixmap->screen_y);
#endif
miCopyRegion(pDrawable, pDrawable,
0, &rgnDst, dx, dy, fbCopyWindowProc, 0, 0);
RegionUninit(&rgnDst);
fbValidateDrawable(&pWin->drawable);
}
示例13: rdpCopyAreaPixmapToWnd
/* draw from an off screen pixmap to a visible window */
static RegionPtr
rdpCopyAreaPixmapToWnd(PixmapPtr pSrcPixmap, rdpPixmapRec *pSrcPriv,
WindowPtr pDstWnd, GCPtr pGC,
int srcx, int srcy, int w, int h,
int dstx, int dsty)
{
int lsrcx;
int lsrcy;
int ldstx;
int ldsty;
int cd;
int j;
int num_clips;
RegionPtr rv;
RegionRec clip_reg;
BoxRec box;
LLOGLN(10, ("rdpCopyAreaPixmapToWnd:"));
RegionInit(&clip_reg, NullBox, 0);
cd = rdp_get_clip(&clip_reg, &(pDstWnd->drawable), pGC);
ldstx = pDstWnd->drawable.x + dstx;
ldsty = pDstWnd->drawable.y + dsty;
lsrcx = pSrcPixmap->drawable.x + srcx;
lsrcy = pSrcPixmap->drawable.y + srcy;
if (cd == 1)
{
rdpup_begin_update();
rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpindex, lsrcx, lsrcy);
rdpup_end_update();
}
else if (cd == 2)
{
num_clips = REGION_NUM_RECTS(&clip_reg);
if (num_clips > 0)
{
rdpup_begin_update();
LLOGLN(10, ("rdpCopyAreaPixmapToWnd: num_clips %d", num_clips));
for (j = 0; j < num_clips; j++)
{
box = REGION_RECTS(&clip_reg)[j];
LLOGLN(10, ("rdpCopyAreaPixmapToWnd: %d %d %d %d", box.x1, box.y1, box.x2, box.y2));
rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
LLOGLN(10, ("rdpCopyAreaPixmapToWnd: %d %d", w, h));
rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpindex, lsrcx, lsrcy);
}
rdpup_reset_clip();
rdpup_end_update();
}
}
RegionUninit(&clip_reg);
rv = rdpCopyAreaOrg(&(pSrcPixmap->drawable), &(pDstWnd->drawable),
pGC, srcx, srcy, w, h, dstx, dsty);
return rv;
}
示例14: compFreeClientWindow
/*
* Free one of the per-client per-window resources, clearing
* redirect and the per-window pointer as appropriate
*/
void
compFreeClientWindow (WindowPtr pWin, XID id)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
CompWindowPtr cw = GetCompWindow (pWin);
CompClientWindowPtr ccw, *prev;
Bool anyMarked = FALSE;
WindowPtr pLayerWin;
PixmapPtr pPixmap = NULL;
if (!cw)
return;
for (prev = &cw->clients; (ccw = *prev); prev = &ccw->next)
{
if (ccw->id == id)
{
*prev = ccw->next;
if (ccw->update == CompositeRedirectManual)
cw->update = CompositeRedirectAutomatic;
free(ccw);
break;
}
}
if (!cw->clients)
{
anyMarked = compMarkWindows (pWin, &pLayerWin);
if (pWin->redirectDraw != RedirectDrawNone) {
pPixmap = (*pScreen->GetWindowPixmap) (pWin);
compSetParentPixmap (pWin);
}
if (cw->damage)
DamageDestroy (cw->damage);
RegionUninit(&cw->borderClip);
dixSetPrivate(&pWin->devPrivates, CompWindowPrivateKey, NULL);
free(cw);
}
else if (cw->update == CompositeRedirectAutomatic &&
!cw->damageRegistered && pWin->redirectDraw != RedirectDrawNone)
{
anyMarked = compMarkWindows (pWin, &pLayerWin);
DamageRegister (&pWin->drawable, cw->damage);
cw->damageRegistered = TRUE;
pWin->redirectDraw = RedirectDrawAutomatic;
DamageDamageRegion(&pWin->drawable, &pWin->borderSize);
}
if (anyMarked)
compHandleMarkedWindows (pWin, pLayerWin);
if (pPixmap) {
compRestoreWindow (pWin, pPixmap);
(*pScreen->DestroyPixmap) (pPixmap);
}
}
示例15: compFreeClientWindow
/*
* Free one of the per-client per-window resources, clearing
* redirect and the per-window pointer as appropriate
*/
void
compFreeClientWindow (WindowPtr pWin, XID id)
{
CompWindowPtr cw = GetCompWindow (pWin);
CompClientWindowPtr ccw, *prev;
Bool wasMapped = pWin->mapped;
if (!cw)
return;
for (prev = &cw->clients; (ccw = *prev); prev = &ccw->next)
{
if (ccw->id == id)
{
*prev = ccw->next;
if (ccw->update == CompositeRedirectManual)
cw->update = CompositeRedirectAutomatic;
free(ccw);
break;
}
}
if (!cw->clients)
{
if (wasMapped)
{
DisableMapUnmapEvents (pWin);
UnmapWindow (pWin, FALSE);
EnableMapUnmapEvents (pWin);
}
if (pWin->redirectDraw != RedirectDrawNone)
compFreePixmap (pWin);
if (cw->damage)
DamageDestroy (cw->damage);
RegionUninit(&cw->borderClip);
dixSetPrivate(&pWin->devPrivates, CompWindowPrivateKey, NULL);
free(cw);
}
else if (cw->update == CompositeRedirectAutomatic &&
!cw->damageRegistered && pWin->redirectDraw != RedirectDrawNone)
{
DamageRegister (&pWin->drawable, cw->damage);
cw->damageRegistered = TRUE;
pWin->redirectDraw = RedirectDrawAutomatic;
DamageRegionAppend(&pWin->drawable, &pWin->borderSize);
}
if (wasMapped && !pWin->mapped)
{
Bool overrideRedirect = pWin->overrideRedirect;
pWin->overrideRedirect = TRUE;
DisableMapUnmapEvents (pWin);
MapWindow (pWin, clients[CLIENT_ID(id)]);
EnableMapUnmapEvents (pWin);
pWin->overrideRedirect = overrideRedirect;
}
}