diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2006-08-07 09:57:58 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2006-08-07 09:57:58 -0700 |
commit | 1c72290cdf4d9b214e1b9c0526cb7cb8641051f3 (patch) | |
tree | 6524968cd18948fabb07158ccb03721001c2e509 | |
parent | ee02e647882a4be29e1130bd79904ee79ed6b802 (diff) |
Use DrawablePtrs instead of PixmapPtrs for Prepare/Finish access.
Also, define some wfb functions even if FB_ACCESS_WRAPPER is not defined. This allows a client to use libfb and libwfb at the same time.
-rw-r--r-- | fb/fb.h | 34 | ||||
-rw-r--r-- | fb/fbpixmap.c | 2 | ||||
-rw-r--r-- | fb/fbpseudocolor.c | 2 |
3 files changed, 17 insertions, 21 deletions
@@ -622,30 +622,28 @@ extern WindowPtr *WindowTable; #endif /* Framebuffer access wrapper */ -#ifdef FB_ACCESS_WRAPPER typedef FbBits (*ReadMemoryProcPtr)(const void *src, int size); typedef void (*WriteMemoryProcPtr)(void *dst, FbBits value, int size); typedef void (*SetupWrapProcPtr)(ReadMemoryProcPtr *pRead, WriteMemoryProcPtr *pWrite, - PixmapPtr pPixmap); -typedef void (*FinishWrapProcPtr)(PixmapPtr pPixmap); -#define fbPrepareAccess(pPix) \ - fbGetScreenPrivate((pPix)->drawable.pScreen)->setupWrap( \ + DrawablePtr pDraw); +typedef void (*FinishWrapProcPtr)(DrawablePtr pDraw); + +#ifdef FB_ACCESS_WRAPPER + +#define fbPrepareAccess(pDraw) \ + fbGetScreenPrivate((pDraw)->pScreen)->setupWrap( \ &wfbReadMemory, \ &wfbWriteMemory, \ - (pPix)) -#define fbFinishAccess(pDrawable) { \ - PixmapPtr _pPix; \ - if ((pDrawable)->type != DRAWABLE_PIXMAP) \ - _pPix = fbGetWindowPixmap(pDrawable); \ - else \ - _pPix = (PixmapPtr) (pDrawable); \ - fbGetScreenPrivate(_pPix->drawable.pScreen)->finishWrap(_pPix); \ -} + (pDraw)) +#define fbFinishAccess(pDraw) \ + fbGetScreenPrivate((pDraw)->pScreen)->finishWrap(pDraw) #else + #define fbPrepareAccess(pPix) #define fbFinishAccess(pDraw) + #endif @@ -739,7 +737,7 @@ typedef struct { (xoff) = __fbPixOffXPix(_pPix); \ (yoff) = __fbPixOffYPix(_pPix); \ } \ - fbPrepareAccess(_pPix); \ + fbPrepareAccess(pDrawable); \ (pointer) = (FbBits *) _pPix->devPrivate.ptr; \ (stride) = ((int) _pPix->devKind) / sizeof (FbBits); (void)(stride); \ (bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \ @@ -756,7 +754,7 @@ typedef struct { (xoff) = __fbPixOffXPix(_pPix); \ (yoff) = __fbPixOffYPix(_pPix); \ } \ - fbPrepareAccess(_pPix); \ + fbPrepareAccess(pDrawable); \ (pointer) = (FbStip *) _pPix->devPrivate.ptr; \ (stride) = ((int) _pPix->devKind) / sizeof (FbStip); (void)(stride); \ (bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \ @@ -1805,7 +1803,6 @@ fbSetupScreen(ScreenPtr pScreen, int width, /* pixel width of frame buffer */ int bpp); /* bits per pixel of frame buffer */ -#ifdef FB_ACCESS_WRAPPER Bool wfbFinishScreenInit(ScreenPtr pScreen, pointer pbits, @@ -1829,7 +1826,7 @@ wfbScreenInit(ScreenPtr pScreen, int bpp, SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap); -#else + Bool fbFinishScreenInit(ScreenPtr pScreen, pointer pbits, @@ -1849,7 +1846,6 @@ fbScreenInit(ScreenPtr pScreen, int dpiy, int width, int bpp); -#endif void fbInitializeBackingStore (ScreenPtr pScreen); diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c index aca37d420..c2ddcb0e9 100644 --- a/fb/fbpixmap.c +++ b/fb/fbpixmap.c @@ -160,7 +160,7 @@ fbPixmapToRegion(PixmapPtr pPix) FirstRect = REGION_BOXPTR(pReg); rects = FirstRect; - fbPrepareAccess(pPix); + fbPrepareAccess(&pPix->drawable); pwLine = (FbBits *) pPix->devPrivate.ptr; nWidth = pPix->devKind >> (FB_SHIFT-3); diff --git a/fb/fbpseudocolor.c b/fb/fbpseudocolor.c index 170fcad0e..f4facbc37 100644 --- a/fb/fbpseudocolor.c +++ b/fb/fbpseudocolor.c @@ -875,7 +875,7 @@ xxCopyPseudocolorRegion(ScreenPtr pScreen, RegionPtr pReg, register CARD16 *d; int w; - fbPrepareAccess((PixmapPtr)pScreen->devPrivate); + fbPrepareAccess((DrawablePtr)pScreen->devPrivate); dst_base = (CARD16*) ((PixmapPtr)pScreen->devPrivate)->devPrivate.ptr; dst_stride = (int)((PixmapPtr)pScreen->devPrivate)->devKind |