• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ REGION_UNINIT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中REGION_UNINIT函数的典型用法代码示例。如果您正苦于以下问题:C++ REGION_UNINIT函数的具体用法?C++ REGION_UNINIT怎么用?C++ REGION_UNINIT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了REGION_UNINIT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: FreeLayerList

static void
FreeLayerList (ScreenPtr pScreen, LayerListPtr pLayList)
{
    REGION_UNINIT (pScreen, &pLayList->clipList);
    REGION_UNINIT (pScreen, &pLayList->borderClip);
    xfree (pLayList);
}
开发者ID:aosm,项目名称:X11,代码行数:7,代码来源:layerwin.c


示例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);
}
开发者ID:alown,项目名称:chromium,代码行数:35,代码来源:vncspu.c


示例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;
}
开发者ID:aosm,项目名称:X11server,代码行数:29,代码来源:xf86Rotate.c


示例4: xglAddCurrentSurfaceDamage

void
xglAddCurrentSurfaceDamage (DrawablePtr pDrawable)
{
    XGL_DRAWABLE_PIXMAP_PRIV (pDrawable);

    if (BOX_NOTEMPTY (&pPixmapPriv->damageBox))
    {
	RegionRec region;

	REGION_INIT (pDrawable->pScreen, &region, &pPixmapPriv->damageBox, 1);

	if (pPixmapPriv->pDamage)
	{
	    RegionPtr pDamageRegion;

	    pDamageRegion = DamageRegion (pPixmapPriv->pDamage);

	    REGION_UNION (pDrawable->pScreen,
			  pDamageRegion, pDamageRegion,
			  &region);
	}

	REGION_UNION (pDrawable->pScreen,
		      &pPixmapPriv->bitRegion, &pPixmapPriv->bitRegion,
		      &region);

	REGION_UNINIT (pDrawable->pScreen, &region);

	pPixmapPriv->damageBox = miEmptyBox;
    }
}
开发者ID:GrahamCobb,项目名称:maemo-xsisusb,代码行数:31,代码来源:xglsync.c


示例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);
}
开发者ID:aosm,项目名称:X11,代码行数:28,代码来源:layerinit.c


示例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);
}
开发者ID:aosm,项目名称:X11,代码行数:26,代码来源:fbwindow.c


示例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, &reg, &box, 1);
    REGION_UNION(pScreen, dst, dst, &reg);
    REGION_UNINIT(pScreen, &reg);

    if (pExaScr->SavedSourceValidate) {
        swap(pExaScr, pScreen, SourceValidate);
        pScreen->SourceValidate(pDrawable, x, y, width, height);
        swap(pExaScr, pScreen, SourceValidate);
    }
}
开发者ID:geekmaster,项目名称:fread-ink,代码行数:35,代码来源:exa_unaccel.c


示例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, &reg, &box, 1);
	pExaScr->prepare_access_reg(pPixmap, index, &reg);
	REGION_UNINIT(pScreen, &reg);
    } else
	exaPrepareAccess(pDrawable, index);
}
开发者ID:geekmaster,项目名称:fread-ink,代码行数:32,代码来源:exa_unaccel.c


示例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);
}
开发者ID:GrahamCobb,项目名称:maemo-xsisusb,代码行数:26,代码来源:kaa.c


示例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);
}
开发者ID:aosm,项目名称:X11,代码行数:34,代码来源:xf86fbman.c


示例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);
}
开发者ID:aosm,项目名称:X11server,代码行数:32,代码来源:fbwindow.c


示例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;
}
开发者ID:GrahamCobb,项目名称:maemo-xsisusb,代码行数:25,代码来源:xglsync.c


示例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, &region, &box, 1);
    REGION_UNION(pScreen, pDamageReg, pDamageReg, &region);
    REGION_UNINIT(pScreen, &region);
}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:29,代码来源:exa.c


示例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;
    }
}
开发者ID:mozyg,项目名称:xorg,代码行数:62,代码来源:compalloc.c


示例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, &reg, pbox, nbox);
	REGION_TRANSLATE(pScreen, &reg, xoff + dx, yoff + dy);
	pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, &reg);
	REGION_UNINIT(pScreen, &reg);
    } 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, &reg, pbox, nbox);
	REGION_TRANSLATE(pScreen, &reg, xoff, yoff);
	pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST, &reg);
	REGION_UNINIT(pScreen, &reg);
    } 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);
}
开发者ID:geekmaster,项目名称:fread-ink,代码行数:45,代码来源:exa_unaccel.c


示例16: xglFillBox

static void
xglFillBox (DrawablePtr pDrawable,
	    GCPtr	pGC,
	    int		x,
	    int		y,
	    int		width,
	    int		height,
	    BoxPtr	pBox,
	    int		nBox)
{
    if (!nBox)
	return;

    if (!xglFill (pDrawable, pGC, NULL, x, y, width, height, pBox, nBox))
    {
	RegionRec region;

	XGL_DRAWABLE_PIXMAP (pDrawable);
	XGL_PIXMAP_PRIV (pPixmap);

	if (!xglMapPixmapBits (pPixmap))
	    FatalError (XGL_SW_FAILURE_STRING);

	switch (pGC->fillStyle) {
	case FillSolid:
	    break;
	case FillStippled:
	case FillOpaqueStippled:
	    if (!xglSyncBits (&pGC->stipple->drawable, NullBox))
		FatalError (XGL_SW_FAILURE_STRING);
	    break;
	case FillTiled:
	    if (!xglSyncBits (&pGC->tile.pixmap->drawable, NullBox))
		FatalError (XGL_SW_FAILURE_STRING);
	    break;
	}

	pPixmapPriv->damageBox = miEmptyBox;

	while (nBox--)
	{
	    fbFill (pDrawable, pGC,
		    pBox->x1, pBox->y1,
		    pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);

	    REGION_INIT (pDrawable->pScreen, &region, pBox, 1);
	    xglAddSurfaceDamage (pDrawable, &region);
	    REGION_UNINIT (pDrawable->pScreen, &region);

	    pBox++;
	}
    } else
	xglAddCurrentBitDamage (pDrawable);
}
开发者ID:GrahamCobb,项目名称:maemo-xsisusb,代码行数:54,代码来源:xglfill.c


示例17: xglPutImage

void
xglPutImage (DrawablePtr pDrawable,
	     GCPtr	 pGC,
	     int	 depth,
	     int	 x,
	     int	 y,
	     int	 w,
	     int	 h,
	     int	 leftPad,
	     int	 format,
	     char	 *bits)
{
    XGL_GC_PRIV (pGC);

    if (pGC->alu != GXcopy || (pGCPriv->flags & xglGCPlaneMaskFlag))
    {
	XGL_GC_OP_FALLBACK_PROLOGUE (pDrawable);
	(*pGC->ops->PutImage) (pDrawable, pGC, depth,
			       x, y, w, h, leftPad, format, bits);
	XGL_GC_OP_FALLBACK_EPILOGUE (pDrawable);
    }
    else
    {
	RegionPtr pClip = pGC->pCompositeClip;
	RegionRec region;
	BoxRec	  box;

	XGL_DRAWABLE_PIXMAP (pDrawable);

	if (!xglMapPixmapBits (pPixmap))
	    FatalError (XGL_SW_FAILURE_STRING);

	XGL_GC_UNWRAP (funcs);
	XGL_GC_UNWRAP (ops);

	(*pGC->ops->PutImage) (pDrawable, pGC, depth,
			       x, y, w, h, leftPad, format, bits);

	XGL_GC_WRAP (funcs, (GCFuncs *) &xglGCFuncs);
	XGL_GC_WRAP (ops, (GCOps *) &xglGCOps);

	box.x1 = pDrawable->x + x;
	box.y1 = pDrawable->y + y;
	box.x2 = box.x1 + w;
	box.y2 = box.y1 + h;

	REGION_INIT (pDrawable->pScreen, &region, &box, 1);
	REGION_INTERSECT (pDrawable->pScreen, &region, pClip, &region);

	xglAddSurfaceDamage (pDrawable, &region);

	REGION_UNINIT (pDrawable->pScreen, &region);
    }
}
开发者ID:Magister,项目名称:x11rdp_xorg71,代码行数:54,代码来源:xglgc.c


示例18: fn_client_add_rect

/**
 * Append given rectangle to the client's list of dirty regions.
 */
void fn_client_add_rect(AIO_SLOT *slot, FB_RECT *rect)
{
  CL_SLOT *cl = (CL_SLOT *)slot;
  RegionRec add_region;
  BoxRec add_rect;
  int stored;
  int dx, dy;

  if (!cl->connected || cl->newfbsize_pending)
    return;

  /* If the framebuffer geometry has been changed, then we don't care
     about pending pixel updates any more, because all clients will
     want to update the whole framebuffer. */

  if (g_screen_info.width != cl->fb_width ||
      g_screen_info.height != cl->fb_height) {
    cl->newfbsize_pending = 1;
    REGION_EMPTY(&cl->pending_region);
    REGION_EMPTY(&cl->copy_region);
    return;
  }

  add_rect.x1 = rect->x;
  add_rect.y1 = rect->y;
  add_rect.x2 = add_rect.x1 + rect->w;
  add_rect.y2 = add_rect.y1 + rect->h;
  REGION_INIT(&add_region, &add_rect, 4);

  /* FIXME: Currently, CopyRect is stored in copy_region only if there
     were no other non-CopyRect updates pending for this client.
     Normally, that's ok, because VNC servers send CopyRect rectangles
     before non-CopyRect ones, but of course more elegant and
     efficient handling could be possible to implement here. */
  stored = 0;
  if (rect->enc == RFB_ENCODING_COPYRECT &&
      cl->enc_enable[RFB_ENCODING_COPYRECT] &&
      !REGION_NOTEMPTY(&cl->pending_region)) {
    dx = rect->x - rect->src_x;
    dy = rect->y - rect->src_y;
    if (!REGION_NOTEMPTY(&cl->copy_region) ||
        (dx == cl->copy_dx && dy == cl->copy_dy)) {
      REGION_UNION(&cl->copy_region, &cl->copy_region, &add_region);
      cl->copy_dx = dx;
      cl->copy_dy = dy;
      stored = 1;
    }
  }
  if (!stored)
    REGION_UNION(&cl->pending_region, &cl->pending_region, &add_region);

  REGION_UNINIT(&add_region);
}
开发者ID:hanzhaogang,项目名称:chromium-1,代码行数:56,代码来源:client_io.c


示例19: cfbCopyWindow

void 
cfbCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{
    DDXPointPtr pptSrc;
    DDXPointPtr ppt;
    RegionRec rgnDst;
    BoxPtr pbox;
    int dx, dy;
    int i, nbox;
    WindowPtr pwinRoot;

    pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];

    REGION_NULL(pWin->drawable.pScreen, &rgnDst);

    dx = ptOldOrg.x - pWin->drawable.x;
    dy = ptOldOrg.y - pWin->drawable.y;
    REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy);
    REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc);

    pbox = REGION_RECTS(&rgnDst);
    nbox = REGION_NUM_RECTS(&rgnDst);
    if(!nbox || !(pptSrc = (DDXPointPtr )ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec))))
    {
	REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
	return;
    }
    ppt = pptSrc;

    for (i = nbox; --i >= 0; ppt++, pbox++)
    {
	ppt->x = pbox->x1 + dx;
	ppt->y = pbox->y1 + dy;
    }

    cfbDoBitbltCopy((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
		GXcopy, &rgnDst, pptSrc, ~0L);
    DEALLOCATE_LOCAL(pptSrc);
    REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
}
开发者ID:marioaugustorama,项目名称:tropix-xwindow,代码行数:40,代码来源:cfbwindow.c


示例20: WindowDirtyUnionCB

/**
 * Union the window's accum-dirty and prev-accum-dirty regions with the
 * incoming region.
 * Called by crHashtableWalk() via vncspuGetScreenRects().
 */
static void
WindowDirtyUnionCB(unsigned long key, void *windowData, void *regionData)
{
	WindowInfo *window = (WindowInfo *) windowData;
	RegionPtr regionUnion = (RegionPtr) regionData;
	RegionRec accumScrn; /* accumulated region, in screen coords */
	Bool overlap;

	miRegionInit(&accumScrn, NULL, 0); /* init local var */

	CRASSERT(miValidRegion(&window->accumDirtyRegion));
	CRASSERT(miValidRegion(&window->prevAccumDirtyRegion));

	/*
	crDebug("accum area: %d   prev accum: %d",
					miRegionArea(&window->accumDirtyRegion),
					miRegionArea(&window->prevAccumDirtyRegion));
	*/

	/* at first, accumScrn region is in window coords */
	REGION_UNION(&accumScrn,
							 &window->accumDirtyRegion,
							 &window->prevAccumDirtyRegion);

	/* intersect with window bounds */
	REGION_INTERSECT(&accumScrn,
									 &accumScrn,
									 &window->clipRegion);

	REGION_VALIDATE(&accumScrn, &overlap);

	/* change y=0=bottom to y=0=top */
	InvertRegion(&accumScrn, window->height ? window->height : 1);

	if (REGION_NUM_RECTS(&accumScrn) == 1 &&
			accumScrn.extents.x1 == 0 &&
			accumScrn.extents.y1 == 0 &&
			accumScrn.extents.x2 == 1 &&
			accumScrn.extents.y2 == 1) {
		/* empty / sentinal region */
	}
	else {
		/* add window offset */
		miTranslateRegion(&accumScrn, window->xPos, window->yPos);
	}

	/* now, accumScrn region is in screen coords */

	REGION_UNION(regionUnion, regionUnion, &accumScrn);

	REGION_UNINIT(&accumScrn); /* done with local var */
}
开发者ID:alown,项目名称:chromium,代码行数:57,代码来源:vncspu.c



注:本文中的REGION_UNINIT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ REGISTER函数代码示例发布时间:2022-05-30
下一篇:
C++ REGION_NUM_RECTS函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap