示例#1
0
文件: cw_render.c 项目: csulmone/X11
static cwPicturePtr
cwCreatePicturePrivate(PicturePtr pPicture)
{
    WindowPtr pWindow = (WindowPtr) pPicture->pDrawable;
    PixmapPtr pPixmap = getCwPixmap(pWindow);
    int error;
    cwPicturePtr pPicturePrivate;

    pPicturePrivate = malloc(sizeof(cwPictureRec));
    if (!pPicturePrivate)
        return NULL;

    pPicturePrivate->pBackingPicture = CreatePicture(0, &pPixmap->drawable,
                                                     pPicture->pFormat,
                                                     0, 0, serverClient,
                                                     &error);
    if (!pPicturePrivate->pBackingPicture) {
        free(pPicturePrivate);
        return NULL;
    }

    /*
     * Ensure that this serial number does not match the window's
     */
    pPicturePrivate->serialNumber = pPixmap->drawable.serialNumber;
    pPicturePrivate->stateChanges = (1 << (CPLastBit + 1)) - 1;

    setCwPicture(pPicture, pPicturePrivate);

    return pPicturePrivate;
}
示例#2
0
文件: cw.c 项目: 4eremuxa/xserver
static PixmapPtr
cwGetWindowPixmap (WindowPtr pWin)
{
    PixmapPtr	pPixmap = getCwPixmap (pWin);

    if (!pPixmap)
    {
	ScreenPtr   pScreen = pWin->drawable.pScreen;
	SCREEN_PROLOGUE(pScreen, GetWindowPixmap);
	if (pScreen->GetWindowPixmap)
	    pPixmap = (*pScreen->GetWindowPixmap) (pWin);
	SCREEN_EPILOGUE(pScreen, GetWindowPixmap, cwGetWindowPixmap);
    }
    return pPixmap;
}
示例#3
0
文件: cw.c 项目: 4eremuxa/xserver
/* Find the real drawable to draw to, and provide offsets that will translate
 * window coordinates to backing pixmap coordinates.
 */
DrawablePtr
cwGetBackingDrawable(DrawablePtr pDrawable, int *x_off, int *y_off)
{
    PixmapPtr	pPixmap;
    
    if (pDrawable->type == DRAWABLE_WINDOW && 
	(pPixmap = getCwPixmap ((WindowPtr) pDrawable)))
    {
	*x_off = pDrawable->x - pPixmap->screen_x;
	*y_off = pDrawable->y - pPixmap->screen_y;
	return &pPixmap->drawable;
    } else {
	*x_off = *y_off = 0;
	return pDrawable;
    }
}
示例#4
0
文件: cw_render.c 项目: csulmone/X11
static PicturePtr
cwGetBackingPicture(PicturePtr pPicture, int *x_off, int *y_off)
{
    cwPicturePrivate;

    if (pPicturePrivate) {
        DrawablePtr pDrawable = pPicture->pDrawable;
        WindowPtr pWindow = (WindowPtr) pDrawable;
        PixmapPtr pPixmap = getCwPixmap(pWindow);

        *x_off = pDrawable->x - pPixmap->screen_x;
        *y_off = pDrawable->y - pPixmap->screen_y;

        return pPicturePrivate->pBackingPicture;
    }
    else {
        *x_off = *y_off = 0;
        return pPicture;
    }
}