示例#1
0
/* Screen initialization/teardown */
void
miInitializeCompositeWrapper(ScreenPtr pScreen)
{
    cwScreenPtr pScreenPriv;

    if (cwDisabled[pScreen->myNum])
	return;

    if (cwGeneration != serverGeneration)
    {
	cwScreenIndex = AllocateScreenPrivateIndex();
	if (cwScreenIndex < 0)
	    return;
	cwGCIndex = AllocateGCPrivateIndex();
	cwWindowIndex = AllocateWindowPrivateIndex();
#ifdef RENDER
	cwPictureIndex = AllocatePicturePrivateIndex();
#endif
	cwGeneration = serverGeneration;
    }
    if (!AllocateGCPrivate(pScreen, cwGCIndex, sizeof(cwGCRec)))
	return;
    if (!AllocateWindowPrivate(pScreen, cwWindowIndex, 0))
	return;
#ifdef RENDER
    if (!AllocatePicturePrivate(pScreen, cwPictureIndex, 0))
	return;
#endif
    pScreenPriv = (cwScreenPtr)xalloc(sizeof(cwScreenRec));
    if (!pScreenPriv)
	return;

    pScreen->devPrivates[cwScreenIndex].ptr = (pointer)pScreenPriv;
    
    SCREEN_EPILOGUE(pScreen, CloseScreen, cwCloseScreen);
    SCREEN_EPILOGUE(pScreen, GetImage, cwGetImage);
    SCREEN_EPILOGUE(pScreen, GetSpans, cwGetSpans);
    SCREEN_EPILOGUE(pScreen, CreateGC, cwCreateGC);
    SCREEN_EPILOGUE(pScreen, PaintWindowBackground, cwPaintWindowBackground);
    SCREEN_EPILOGUE(pScreen, PaintWindowBorder, cwPaintWindowBorder);
    SCREEN_EPILOGUE(pScreen, CopyWindow, cwCopyWindow);

    SCREEN_EPILOGUE(pScreen, SetWindowPixmap, cwSetWindowPixmap);
    SCREEN_EPILOGUE(pScreen, GetWindowPixmap, cwGetWindowPixmap);

#ifdef RENDER
    if (GetPictureScreen (pScreen))
	cwInitializeRender(pScreen);
#endif
}
示例#2
0
/** Initialize the RENDER extension, allocate the picture privates and
 *  wrap mi function hooks.  If the shadow frame buffer is used, then
 *  call the appropriate fb initialization function. */
Bool dmxPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
{
    DMXScreenInfo    *dmxScreen = &dmxScreens[pScreen->myNum];
    PictureScreenPtr  ps;

    /* The shadow framebuffer only relies on FB to be initialized */
    if (dmxShadowFB) return fbPictureInit(pScreen, formats, nformats);

    if (!miPictureInit(pScreen, formats, nformats))
	return FALSE;

    if (!AllocatePicturePrivate(pScreen, dmxPictPrivateIndex,
				sizeof(dmxPictPrivRec)))
	return FALSE;

    ps = GetPictureScreen(pScreen);

    DMX_WRAP(CreatePicture,      dmxCreatePicture,      dmxScreen, ps);
    DMX_WRAP(DestroyPicture,     dmxDestroyPicture,     dmxScreen, ps);

    DMX_WRAP(ChangePictureClip,  dmxChangePictureClip,  dmxScreen, ps);
    DMX_WRAP(DestroyPictureClip, dmxDestroyPictureClip, dmxScreen, ps);

    DMX_WRAP(ChangePicture,      dmxChangePicture,      dmxScreen, ps);
    DMX_WRAP(ValidatePicture,    dmxValidatePicture,    dmxScreen, ps);

    DMX_WRAP(Composite,          dmxComposite,          dmxScreen, ps);
    DMX_WRAP(Glyphs,             dmxGlyphs,             dmxScreen, ps);
    DMX_WRAP(CompositeRects,     dmxCompositeRects,     dmxScreen, ps);

    DMX_WRAP(Trapezoids,         dmxTrapezoids,         dmxScreen, ps);
    DMX_WRAP(Triangles,          dmxTriangles,          dmxScreen, ps);
    DMX_WRAP(TriStrip,           dmxTriStrip,           dmxScreen, ps);
    DMX_WRAP(TriFan,             dmxTriFan,             dmxScreen, ps);

    return TRUE;
}