本文整理汇总了C++中REGION_UNINIT函数的典型用法代码示例。如果您正苦于以下问题:C++ REGION_UNINIT函数的具体用法?C++ REGION_UNINIT怎么用?C++ REGION_UNINIT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了REGION_UNINIT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FreeLayerList
static void
FreeLayerList (ScreenPtr pScreen, LayerListPtr pLayList)
{
REGION_UNINIT (pScreen, &pLayList->clipList);
REGION_UNINIT (pScreen, &pLayList->borderClip);
xfree (pLayList);
}
示例2: InvertRegion
/**
* Vertically invert a region.
*/
static void
InvertRegion(RegionPtr reg, int height)
{
const BoxPtr b = REGION_RECTS(reg);
const int n = REGION_NUM_RECTS(reg);
int i;
RegionRec newRegion;
miRegionInit(&newRegion, NULL, 0);
CRASSERT(miValidRegion(reg));
for (i = 0; i < n; i++) {
BoxRec invBox;
RegionRec invReg;
invBox.x1 = b[i].x1;
invBox.y1 = height - b[i].y2;
invBox.x2 = b[i].x2;
invBox.y2 = height - b[i].y1;
CRASSERT(invBox.y1 <= invBox.y2);
miRegionInit(&invReg, &invBox, 1);
REGION_UNION(&newRegion, &newRegion, &invReg);
REGION_UNINIT(&invReg);
}
CRASSERT(miValidRegion(&newRegion));
REGION_COPY(reg, &newRegion);
REGION_UNINIT(&newRegion);
}
示例3: xf86CrtcDamageShadow
static void
xf86CrtcDamageShadow (xf86CrtcPtr crtc)
{
ScrnInfoPtr pScrn = crtc->scrn;
BoxRec damage_box;
RegionRec damage_region;
ScreenPtr pScreen = pScrn->pScreen;
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;
REGION_INIT (pScreen, &damage_region, &damage_box, 1);
DamageRegionAppend (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
&damage_region);
REGION_UNINIT (pScreen, &damage_region);
crtc->shadowClear = TRUE;
}
示例4: xglAddCurrentSurfaceDamage
void
xglAddCurrentSurfaceDamage (DrawablePtr pDrawable)
{
XGL_DRAWABLE_PIXMAP_PRIV (pDrawable);
if (BOX_NOTEMPTY (&pPixmapPriv->damageBox))
{
RegionRec region;
REGION_INIT (pDrawable->pScreen, ®ion, &pPixmapPriv->damageBox, 1);
if (pPixmapPriv->pDamage)
{
RegionPtr pDamageRegion;
pDamageRegion = DamageRegion (pPixmapPriv->pDamage);
REGION_UNION (pDrawable->pScreen,
pDamageRegion, pDamageRegion,
®ion);
}
REGION_UNION (pDrawable->pScreen,
&pPixmapPriv->bitRegion, &pPixmapPriv->bitRegion,
®ion);
REGION_UNINIT (pDrawable->pScreen, ®ion);
pPixmapPriv->damageBox = miEmptyBox;
}
}
示例5: LayerDestroy
/*
* Destroy a layer. The layer must not contain any windows.
*/
void
LayerDestroy (ScreenPtr pScreen, LayerPtr pLay)
{
layerScrPriv(pScreen);
LayerPtr *pPrev;
--pLay->refcnt;
if (pLay->refcnt > 0)
return;
/*
* Unhook the layer from the list
*/
for (pPrev = &pLayScr->pLayers; *pPrev; pPrev = &(*pPrev)->pNext)
if (*pPrev == pLay)
{
*pPrev = pLay->pNext;
break;
}
/*
* Free associated storage
*/
LayerDestroyPixmap (pScreen, pLay);
REGION_UNINIT (pScreen, &pLay->region);
xfree (pLay);
}
示例6: fbCopyWindow
void
fbCopyWindow(WindowPtr pWin,
DDXPointRec ptOldOrg,
RegionPtr prgnSrc)
{
RegionRec rgnDst;
int dx, dy;
WindowPtr pwinRoot;
pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
REGION_NULL (pWin->drawable.pScreen, &rgnDst);
REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
fbCopyRegion ((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
0,
&rgnDst, dx, dy, fbCopyWindowProc, 0, 0);
REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
fbValidateDrawable (&pWin->drawable);
}
示例7: ExaSrcValidate
static void
ExaSrcValidate(DrawablePtr pDrawable,
int x,
int y,
int width,
int height)
{
ScreenPtr pScreen = pDrawable->pScreen;
ExaScreenPriv(pScreen);
PixmapPtr pPix = exaGetDrawablePixmap (pDrawable);
BoxRec box;
RegionRec reg;
RegionPtr dst;
int xoff, yoff;
exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff);
box.x1 = x + xoff;
box.y1 = y + yoff;
box.x2 = box.x1 + width;
box.y2 = box.y1 + height;
dst = (pExaScr->srcPix == pPix) ? &pExaScr->srcReg :
&pExaScr->maskReg;
REGION_INIT(pScreen, ®, &box, 1);
REGION_UNION(pScreen, dst, dst, ®);
REGION_UNINIT(pScreen, ®);
if (pExaScr->SavedSourceValidate) {
swap(pExaScr, pScreen, SourceValidate);
pScreen->SourceValidate(pDrawable, x, y, width, height);
swap(pExaScr, pScreen, SourceValidate);
}
}
示例8: 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;
REGION_INIT(pScreen, ®, &box, 1);
pExaScr->prepare_access_reg(pPixmap, index, ®);
REGION_UNINIT(pScreen, ®);
} else
exaPrepareAccess(pDrawable, index);
}
示例9: kaaCopyWindow
static void
kaaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{
RegionRec rgnDst;
int dx, dy;
PixmapPtr pPixmap = (*pWin->drawable.pScreen->GetWindowPixmap) (pWin);
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
REGION_INIT (pWin->drawable.pScreen, &rgnDst, NullBox, 0);
REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
#ifdef COMPOSITE
if (pPixmap->screen_x || pPixmap->screen_y)
REGION_TRANSLATE (pWin->drawable.pScreen, &rgnDst,
-pPixmap->screen_x, -pPixmap->screen_y);
#endif
fbCopyRegion (&pPixmap->drawable, &pPixmap->drawable,
0,
&rgnDst, dx, dy, kaaCopyNtoN, 0, 0);
REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
}
示例10: localFreeOffscreenArea
static void
localFreeOffscreenArea(FBAreaPtr area)
{
FBManagerPtr offman;
FBLinkPtr pLink, pLinkPrev = NULL;
RegionRec FreedRegion;
ScreenPtr pScreen;
pScreen = area->pScreen;
offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
pLink = offman->UsedAreas;
if(!pLink) return;
while(&(pLink->area) != area) {
pLinkPrev = pLink;
pLink = pLink->next;
if(!pLink) return;
}
/* put the area back into the pool */
REGION_INIT(pScreen, &FreedRegion, &(pLink->area.box), 1);
REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedRegion);
REGION_UNINIT(pScreen, &FreedRegion);
if(pLinkPrev)
pLinkPrev->next = pLink->next;
else offman->UsedAreas = pLink->next;
xfree(pLink);
offman->NumUsedAreas--;
SendCallFreeBoxCallbacks(offman);
}
示例11: 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;
REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
REGION_NULL (pWin->drawable.pScreen, &rgnDst);
REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
#ifdef COMPOSITE
if (pPixmap->screen_x || pPixmap->screen_y)
REGION_TRANSLATE (pWin->drawable.pScreen, &rgnDst,
-pPixmap->screen_x, -pPixmap->screen_y);
#endif
fbCopyRegion (pDrawable, pDrawable,
0,
&rgnDst, dx, dy, fbCopyWindowProc, 0, 0);
REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
fbValidateDrawable (&pWin->drawable);
}
示例12: xglAddCurrentBitDamage
void
xglAddCurrentBitDamage (DrawablePtr pDrawable)
{
XGL_DRAWABLE_PIXMAP_PRIV (pDrawable);
if (REGION_NOTEMPTY (pDrawable->pScreen, &pPixmapPriv->bitRegion))
{
BoxPtr pBitExt;
pBitExt = REGION_EXTENTS (pDrawable->pScreen, &pPixmapPriv->bitRegion);
if (pPixmapPriv->damageBox.x1 < pBitExt->x2 &&
pPixmapPriv->damageBox.y1 < pBitExt->y2 &&
pPixmapPriv->damageBox.x2 > pBitExt->x1 &&
pPixmapPriv->damageBox.y2 > pBitExt->y1)
{
REGION_UNINIT (pDrawable->pScreen, &pPixmapPriv->bitRegion);
REGION_INIT (pDrawable->pScreen, &pPixmapPriv->bitRegion,
NullBox, 0);
pPixmapPriv->allBits = FALSE;
}
}
pPixmapPriv->damageBox = miEmptyBox;
}
示例13: exaPixmapDirty
/**
* exaPixmapDirty() marks a pixmap as dirty, allowing for
* optimizations in pixmap migration when no changes have occurred.
*/
void
exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2)
{
ExaPixmapPriv(pPix);
BoxRec box;
RegionPtr pDamageReg;
RegionRec region;
if (!pExaPixmap)
return;
box.x1 = max(x1, 0);
box.y1 = max(y1, 0);
box.x2 = min(x2, pPix->drawable.width);
box.y2 = min(y2, pPix->drawable.height);
if (box.x1 >= box.x2 || box.y1 >= box.y2)
return;
pDamageReg = DamageRegion(pExaPixmap->pDamage);
REGION_INIT(pScreen, ®ion, &box, 1);
REGION_UNION(pScreen, pDamageReg, pDamageReg, ®ion);
REGION_UNINIT(pScreen, ®ion);
}
示例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)
{
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;
xfree (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);
REGION_UNINIT (pScreen, &cw->borderClip);
dixSetPrivate(&pWin->devPrivates, CompWindowPrivateKey, NULL);
xfree (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;
}
}
示例15: 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) {
PixmapPtr pPixmap = exaGetDrawablePixmap(pSrc);
exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff);
REGION_INIT(pScreen, ®, pbox, nbox);
REGION_TRANSLATE(pScreen, ®, xoff + dx, yoff + dy);
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, ®);
REGION_UNINIT(pScreen, ®);
} else
exaPrepareAccess (pSrc, EXA_PREPARE_SRC);
if (pExaScr->prepare_access_reg &&
!exaGCReadsDestination(pDst, pGC->planemask, pGC->fillStyle,
pGC->alu, pGC->clientClipType)) {
PixmapPtr pPixmap = exaGetDrawablePixmap(pDst);
exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff);
REGION_INIT(pScreen, ®, pbox, nbox);
REGION_TRANSLATE(pScreen, ®, xoff, yoff);
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST, ®);
REGION_UNINIT(pScreen, ®);
} 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);
}