コード例 #1
0
ファイル: xf86DiDGA.c プロジェクト: GrahamCobb/maemo-xsisusb
static void
xf86_dga_sync(ScrnInfoPtr scrn)
{
    ScreenPtr	pScreen = scrn->pScreen;
    WindowPtr	pRoot = WindowTable [pScreen->myNum];
    char	buffer[4];

    pScreen->GetImage (&pRoot->drawable, 0, 0, 1, 1, ZPixmap, ~0L, buffer);
}
コード例 #2
0
ファイル: rootlessScreen.c プロジェクト: aosm/X11server
static void
RootlessGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
                 unsigned int format, unsigned long planeMask, char *pdstLine)
{
    ScreenPtr pScreen = pDrawable->pScreen;
    SCREEN_UNWRAP(pScreen, GetImage);

    if (pDrawable->type == DRAWABLE_WINDOW) {
        int x0, y0, x1, y1;
        RootlessWindowRec *winRec;

        // Many apps use GetImage to sync with the visible frame buffer
        // FIXME: entire screen or just window or all screens?
        RootlessRedisplayScreen(pScreen);

        // RedisplayScreen stops drawing, so we need to start it again
        RootlessStartDrawing((WindowPtr)pDrawable);

        /* Check that we have some place to read from. */
        winRec = WINREC(TopLevelParent((WindowPtr) pDrawable));
        if (winRec == NULL)
            goto out;

        /* Clip to top-level window bounds. */
        /* FIXME: fbGetImage uses the width parameter to calculate the
           stride of the destination pixmap. If w is clipped, the data
           returned will be garbage, although we will not crash. */

        x0 = pDrawable->x + sx;
        y0 = pDrawable->y + sy;
        x1 = x0 + w;
        y1 = y0 + h;

        x0 = max (x0, winRec->x);
        y0 = max (y0, winRec->y);
        x1 = min (x1, winRec->x + winRec->width);
        y1 = min (y1, winRec->y + winRec->height);

        sx = x0 - pDrawable->x;
        sy = y0 - pDrawable->y;
        w = x1 - x0;
        h = y1 - y0;

        if (w <= 0 || h <= 0)
            goto out;
    }

    pScreen->GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);

out:
    SCREEN_WRAP(pScreen, GetImage);
}
コード例 #3
0
ファイル: shadow.c プロジェクト: GrahamCobb/maemo-xsisusb
static void
shadowGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
	       unsigned int format, unsigned long planeMask, char *pdstLine)
{
    ScreenPtr pScreen = pDrawable->pScreen;
    shadowBuf(pScreen);

    /* Many apps use GetImage to sync with the visable frame buffer */
    if (pDrawable->type == DRAWABLE_WINDOW)
	shadowRedisplay(pScreen);
    unwrap(pBuf, pScreen, GetImage);
    pScreen->GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);
    wrap(pBuf, pScreen, GetImage);
}
コード例 #4
0
ファイル: exa_unaccel.c プロジェクト: MrKepzie/xserver
void
ExaCheckGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
                 unsigned int format, unsigned long planeMask, char *d)
{
    ScreenPtr pScreen = pDrawable->pScreen;

    EXA_PRE_FALLBACK(pScreen);
    EXA_FALLBACK(("from %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));

    ExaFallbackPrepareReg(pDrawable, NULL, x, y, w, h, EXA_PREPARE_SRC, FALSE);
    swap(pExaScr, pScreen, GetImage);
    pScreen->GetImage(pDrawable, x, y, w, h, format, planeMask, d);
    swap(pExaScr, pScreen, GetImage);
    exaFinishAccess(pDrawable, EXA_PREPARE_SRC);
    EXA_POST_FALLBACK(pScreen);
}
コード例 #5
0
ファイル: rootlessScreen.c プロジェクト: dikerex/theqvd
static void
RootlessGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
                 unsigned int format, unsigned long planeMask, char *pdstLine)
{
    ScreenPtr pScreen = pDrawable->pScreen;
    SCREEN_UNWRAP(pScreen, GetImage);

    if (pDrawable->type == DRAWABLE_WINDOW) {
        /* Many apps use GetImage to sync with the visible frame buffer */
        // fixme entire screen or just window or all screens?
        RootlessRedisplayScreen(pScreen);
    }

    pScreen->GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine);

    SCREEN_WRAP(pScreen, GetImage);
}