Split fbGetDrawable into fbGetDrawablePixmap and fbGetPixmapBitsData
These two sub-macros each perform half of the original macro work and the old macro is now implemented in terms of the new ones. This makes way for new code which wants to know the underlying pixmap for a window instead of just getting a pointer to the bits. Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
This commit is contained in:
parent
6133505297
commit
bd567061c8
63
fb/fb.h
63
fb/fb.h
|
@ -700,38 +700,41 @@ typedef struct {
|
|||
#define __fbPixOffXPix(pPix) (__fbPixDrawableX(pPix))
|
||||
#define __fbPixOffYPix(pPix) (__fbPixDrawableY(pPix))
|
||||
|
||||
#define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
|
||||
PixmapPtr _pPix; \
|
||||
if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
|
||||
_pPix = fbGetWindowPixmap(pDrawable); \
|
||||
(xoff) = __fbPixOffXWin(_pPix); \
|
||||
(yoff) = __fbPixOffYWin(_pPix); \
|
||||
} else { \
|
||||
_pPix = (PixmapPtr) (pDrawable); \
|
||||
(xoff) = __fbPixOffXPix(_pPix); \
|
||||
(yoff) = __fbPixOffYPix(_pPix); \
|
||||
} \
|
||||
fbPrepareAccess(pDrawable); \
|
||||
(pointer) = (FbBits *) _pPix->devPrivate.ptr; \
|
||||
(stride) = ((int) _pPix->devKind) / sizeof (FbBits); (void)(stride); \
|
||||
(bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
|
||||
#define fbGetDrawablePixmap(pDrawable, pixmap, xoff, yoff) { \
|
||||
if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
|
||||
(pixmap) = fbGetWindowPixmap(pDrawable); \
|
||||
(xoff) = __fbPixOffXWin(pixmap); \
|
||||
(yoff) = __fbPixOffYWin(pixmap); \
|
||||
} else { \
|
||||
(pixmap) = (PixmapPtr) (pDrawable); \
|
||||
(xoff) = __fbPixOffXPix(pixmap); \
|
||||
(yoff) = __fbPixOffYPix(pixmap); \
|
||||
} \
|
||||
fbPrepareAccess(pDrawable); \
|
||||
}
|
||||
|
||||
#define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
|
||||
PixmapPtr _pPix; \
|
||||
if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
|
||||
_pPix = fbGetWindowPixmap(pDrawable); \
|
||||
(xoff) = __fbPixOffXWin(_pPix); \
|
||||
(yoff) = __fbPixOffYWin(_pPix); \
|
||||
} else { \
|
||||
_pPix = (PixmapPtr) (pDrawable); \
|
||||
(xoff) = __fbPixOffXPix(_pPix); \
|
||||
(yoff) = __fbPixOffYPix(_pPix); \
|
||||
} \
|
||||
fbPrepareAccess(pDrawable); \
|
||||
(pointer) = (FbStip *) _pPix->devPrivate.ptr; \
|
||||
(stride) = ((int) _pPix->devKind) / sizeof (FbStip); (void)(stride); \
|
||||
(bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
|
||||
#define fbGetPixmapBitsData(pixmap, pointer, stride, bpp) { \
|
||||
(pointer) = (FbBits *) (pixmap)->devPrivate.ptr; \
|
||||
(stride) = ((int) (pixmap)->devKind) / sizeof (FbBits); (void)(stride); \
|
||||
(bpp) = (pixmap)->drawable.bitsPerPixel; (void)(bpp); \
|
||||
}
|
||||
|
||||
#define fbGetPixmapStipData(pixmap, pointer, stride, bpp) { \
|
||||
(pointer) = (FbStip *) (pixmap)->devPrivate.ptr; \
|
||||
(stride) = ((int) (pixmap)->devKind) / sizeof (FbStip); (void)(stride); \
|
||||
(bpp) = (pixmap)->drawable.bitsPerPixel; (void)(bpp); \
|
||||
}
|
||||
|
||||
#define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
|
||||
PixmapPtr _pPix; \
|
||||
fbGetDrawablePixmap(pDrawable, _pPix, xoff, yoff); \
|
||||
fbGetPixmapBitsData(_pPix, pointer, stride, bpp); \
|
||||
}
|
||||
|
||||
#define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
|
||||
PixmapPtr _pPix; \
|
||||
fbGetDrawablePixmap(pDrawable, _pPix, xoff, yoff); \
|
||||
fbGetPixmapStipData(_pPix, pointer, stride, bpp); \
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue
Block a user