예제 #1
0
/*
 * xprSetupScreen
 *  Setup the screen for rootless access.
 */
static Bool
xprSetupScreen(int index, ScreenPtr pScreen)
{
    // Add alpha protecting replacements for fb screen functions
    pScreen->PaintWindowBackground = SafeAlphaPaintWindow;
    pScreen->PaintWindowBorder = SafeAlphaPaintWindow;

#ifdef RENDER
    {
        PictureScreenPtr ps = GetPictureScreen(pScreen);
        ps->Composite = SafeAlphaComposite;
    }
#endif /* RENDER */

    // Initialize accelerated rootless drawing
    // Note that this must be done before DamageSetup().
    RootlessAccelInit(pScreen);

#ifdef DAMAGE
    // The Damage extension needs to wrap underneath the
    // generic rootless layer, so do it now.
    if (!DamageSetup(pScreen))
        return FALSE;
#endif

    // Initialize generic rootless code
    if (!xprInit(pScreen))
        return FALSE;

    return DRIFinishScreenInit(pScreen);
}
예제 #2
0
void
DamageExtensionInit(void)
{
    ExtensionEntry *extEntry;
    int		    s;

    for (s = 0; s < screenInfo.numScreens; s++)
	DamageSetup (screenInfo.screens[s]);

    DamageExtType = CreateNewResourceType (FreeDamageExt, "DamageExt");
    if (!DamageExtType)
	return;

    DamageExtWinType = CreateNewResourceType (FreeDamageExtWin, "DamageExtWin");
    if (!DamageExtWinType)
	return;

    if (!dixRegisterPrivateKey(&DamageClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (DamageClientRec)))
	return;

    if (!AddCallback (&ClientStateCallback, DamageClientCallback, 0))
	return;

    if ((extEntry = AddExtension(DAMAGE_NAME, XDamageNumberEvents, 
				 XDamageNumberErrors,
				 ProcDamageDispatch, SProcDamageDispatch,
				 DamageResetProc, StandardMinorOpcode)) != 0)
    {
	DamageReqCode = (unsigned char)extEntry->base;
	DamageEventBase = extEntry->eventBase;
	EventSwapVector[DamageEventBase + XDamageNotify] =
			(EventSwapPtr) SDamageNotifyEvent;
	SetResourceTypeErrorValue(DamageExtType, extEntry->errorBase + BadDamage);
    }
}
예제 #3
0
Bool
shadowSetup(ScreenPtr pScreen)
{
    shadowBufPtr pBuf;

    if (!DamageSetup(pScreen))
	return FALSE;

    if (shadowGeneration != serverGeneration) {
	shadowScrPrivateIndex = AllocateScreenPrivateIndex();
	if (shadowScrPrivateIndex == -1)
	    return FALSE;
	shadowGeneration = serverGeneration;
    }

    pBuf = (shadowBufPtr) xalloc(sizeof(shadowBufRec));
    if (!pBuf)
	return FALSE;
#ifdef BACKWARDS_COMPATIBILITY
    pBuf->pDamage = DamageCreate((DamageReportFunc)shadowReportFunc, 
		    		 (DamageDestroyFunc)NULL,
				 DamageReportRawRegion,
				 TRUE, pScreen, pScreen);
#else
    pBuf->pDamage = DamageCreate((DamageReportFunc)NULL, 
		    		 (DamageDestroyFunc)NULL,
				 DamageReportNone,
				 TRUE, pScreen, pScreen);
#endif
    if (!pBuf->pDamage) {
	xfree(pBuf);
	return FALSE;
    }

    wrap(pBuf, pScreen, CloseScreen);
    wrap(pBuf, pScreen, GetImage);
    pBuf->update = NULL;
    pBuf->window = NULL;
    pBuf->pPixmap = 0;
    pBuf->closure = 0;
    pBuf->randr = 0;
    pBuf->ready_to_update = NULL;
#ifdef BACKWARDS_COMPATIBILITY
    REGION_NULL(pScreen, &pBuf->damage); /* bc */
#endif

    pScreen->devPrivates[shadowScrPrivateIndex].ptr = (pointer) pBuf;
    return TRUE;
}
/*
 * xprSetupScreen
 *  Setup the screen for rootless access.
 */
static Bool
xprSetupScreen(int index, ScreenPtr pScreen)
{
#ifdef DAMAGE
    // The Damage extension needs to wrap underneath the
    // generic rootless layer, so do it now.
    if (!DamageSetup(pScreen))
        return FALSE;
#endif

    // Initialize generic rootless code
    if (!xprInit(pScreen))
        return FALSE;

    return DRIFinishScreenInit(pScreen);
}
예제 #5
0
파일: shadow.c 프로젝트: MrKepzie/xserver
Bool
shadowSetup(ScreenPtr pScreen)
{
    shadowBufPtr pBuf;

    if (!dixRegisterPrivateKey(&shadowScrPrivateKeyRec, PRIVATE_SCREEN, 0))
        return FALSE;

    if (!DamageSetup(pScreen))
        return FALSE;

    pBuf = malloc(sizeof(shadowBufRec));
    if (!pBuf)
        return FALSE;
#ifdef BACKWARDS_COMPATIBILITY
    pBuf->pDamage = DamageCreate((DamageReportFunc) shadowReportFunc,
                                 (DamageDestroyFunc) NULL,
                                 DamageReportRawRegion, TRUE, pScreen, pScreen);
#else
    pBuf->pDamage = DamageCreate((DamageReportFunc) NULL,
                                 (DamageDestroyFunc) NULL,
                                 DamageReportNone, TRUE, pScreen, pScreen);
#endif
    if (!pBuf->pDamage) {
        free(pBuf);
        return FALSE;
    }

    wrap(pBuf, pScreen, CloseScreen);
    wrap(pBuf, pScreen, GetImage);
    pBuf->update = 0;
    pBuf->window = 0;
    pBuf->pPixmap = 0;
    pBuf->closure = 0;
    pBuf->randr = 0;
#ifdef BACKWARDS_COMPATIBILITY
    RegionNull(&pBuf->damage);  /* bc */
#endif

    dixSetPrivate(&pScreen->devPrivates, shadowScrPrivateKey, pBuf);
    return TRUE;
}
예제 #6
0
void
DamageExtensionInit(void)
{
    ExtensionEntry *extEntry;
    int		    s;

    for (s = 0; s < screenInfo.numScreens; s++)
        DamageSetup (screenInfo.screens[s]);

    DamageExtType = CreateNewResourceType (FreeDamageExt);
    if (!DamageExtType)
        return;

    DamageExtWinType = CreateNewResourceType (FreeDamageExtWin);
    if (!DamageExtWinType)
        return;

    DamageClientPrivateIndex = AllocateClientPrivateIndex ();
    if (!AllocateClientPrivate (DamageClientPrivateIndex,
                                sizeof (DamageClientRec)))
        return;
    if (!AddCallback (&ClientStateCallback, DamageClientCallback, 0))
        return;

    if ((extEntry = AddExtension(DAMAGE_NAME, XDamageNumberEvents,
                                 XDamageNumberErrors,
                                 ProcDamageDispatch, SProcDamageDispatch,
                                 DamageResetProc, StandardMinorOpcode)) != 0)
    {
        DamageReqCode = (unsigned char)extEntry->base;
        DamageEventBase = extEntry->eventBase;
        DamageErrorBase = extEntry->errorBase;
        EventSwapVector[DamageEventBase + XDamageNotify] =
            (EventSwapPtr) SDamageNotifyEvent;
    }
}