exa: create ExaCheckGetImage

This commit is contained in:
Maarten Maathuis 2009-01-31 19:57:07 +01:00
parent 258fc4b106
commit f06bde3d4b
3 changed files with 35 additions and 6 deletions

View File

@ -1201,12 +1201,7 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h,
}
fallback:
EXA_FALLBACK(("from %p (%c)\n", pDrawable,
exaDrawableLocation(pDrawable)));
exaPrepareAccessReg (pDrawable, EXA_PREPARE_SRC, &Reg);
fbGetImage (pDrawable, x, y, w, h, format, planeMask, d);
exaFinishAccess (pDrawable, EXA_PREPARE_SRC);
ExaCheckGetImage(pDrawable, x, y, w, h, format, planeMask, d);
out:
REGION_UNINIT(pScreen, &Reg);

View File

@ -360,6 +360,10 @@ ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap,
DrawablePtr pDrawable,
int w, int h, int x, int y);
void
ExaCheckGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
unsigned int format, unsigned long planeMask, char *d);
void
ExaCheckGetSpans (DrawablePtr pDrawable,
int wMax,

View File

@ -282,6 +282,36 @@ ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap,
EXA_GC_EPILOGUE(pGC);
}
void
ExaCheckGetImage(DrawablePtr pDrawable, int x, int y, int w, int h,
unsigned int format, unsigned long planeMask, char *d)
{
BoxRec Box;
RegionRec Reg;
int xoff, yoff;
ScreenPtr pScreen = pDrawable->pScreen;
PixmapPtr pPix = exaGetDrawablePixmap (pDrawable);
ExaScreenPriv(pScreen);
EXA_FALLBACK(("from %p (%c)\n", pDrawable,
exaDrawableLocation(pDrawable)));
exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff);
Box.x1 = pDrawable->y + x + xoff;
Box.y1 = pDrawable->y + y + yoff;
Box.x2 = Box.x1 + w;
Box.y2 = Box.y1 + h;
REGION_INIT(pScreen, &Reg, &Box, 1);
exaPrepareAccessReg (pDrawable, EXA_PREPARE_SRC, &Reg);
swap(pExaScr, pScreen, GetImage);
pScreen->GetImage (pDrawable, x, y, w, h, format, planeMask, d);
swap(pExaScr, pScreen, GetImage);
exaFinishAccess (pDrawable, EXA_PREPARE_SRC);
}
void
ExaCheckGetSpans (DrawablePtr pDrawable,
int wMax,