45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright © 1998 Keith Packard
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Permission to use, copy, modify, distribute, and sell this software and its
45e9809aff7304721fddb95654901b32195c9c7avboxsync * documentation for any purpose is hereby granted without fee, provided that
45e9809aff7304721fddb95654901b32195c9c7avboxsync * the above copyright notice appear in all copies and that both that
45e9809aff7304721fddb95654901b32195c9c7avboxsync * copyright notice and this permission notice appear in supporting
45e9809aff7304721fddb95654901b32195c9c7avboxsync * documentation, and that the name of Keith Packard not be used in
45e9809aff7304721fddb95654901b32195c9c7avboxsync * advertising or publicity pertaining to distribution of the software without
45e9809aff7304721fddb95654901b32195c9c7avboxsync * specific, written prior permission. Keith Packard makes no
45e9809aff7304721fddb95654901b32195c9c7avboxsync * representations about the suitability of this software for any purpose. It
45e9809aff7304721fddb95654901b32195c9c7avboxsync * is provided "as is" without express or implied warranty.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
45e9809aff7304721fddb95654901b32195c9c7avboxsync * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
45e9809aff7304721fddb95654901b32195c9c7avboxsync * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
45e9809aff7304721fddb95654901b32195c9c7avboxsync * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
45e9809aff7304721fddb95654901b32195c9c7avboxsync * PERFORMANCE OF THIS SOFTWARE.
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define WRITE(ptr, val) ((*wfbWriteMemory)((ptr), (val), sizeof(*(ptr))))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define READ(ptr) ((*wfbReadMemory)((ptr), sizeof(*(ptr))))
45e9809aff7304721fddb95654901b32195c9c7avboxsync CARD8 *_dst = (CARD8*)(dst), *_src = (CARD8*)(src); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define MEMCPY_WRAPPED(dst, src, size) memcpy((dst), (src), (size))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define MEMSET_WRAPPED(dst, val, size) memset((dst), (val), (size))
45e9809aff7304721fddb95654901b32195c9c7avboxsync * This single define controls the basic size of data manipulated
45e9809aff7304721fddb95654901b32195c9c7avboxsync * by this software; it must be log2(sizeof (FbBits) * 8)
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* whether to bother to include 24bpp support */
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Unless otherwise instructed, fb includes code to advertise 24bpp
45e9809aff7304721fddb95654901b32195c9c7avboxsync * windows with 32bpp image format for application compatibility
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FB_STIP_ODDSTRIDE(s) (((s) & (FB_MASK >> FB_STIP_SHIFT)) != 0)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FB_STIP_ODDPTR(p) ((((long) (p)) & (FB_MASK >> 3)) != 0)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbStipStrideToBitsStride(s) (((s) >> (FB_SHIFT - FB_STIP_SHIFT)))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbBitsStrideToStipStride(s) (((s) << (FB_SHIFT - FB_STIP_SHIFT)))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbFullMask(n) ((n) == FB_UNIT ? FB_ALLONES : ((((FbBits) 1) << n) - 1))
45e9809aff7304721fddb95654901b32195c9c7avboxsync defined(__s390x__) || \
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef unsigned long FbBits;
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef unsigned long long FbBits;
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void fbValidateDrawable(DrawablePtr d);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void fbInitializeDrawable(DrawablePtr d);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void fbSetBits (FbStip *bits, int stride, FbStip data);
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* #define FbLeftBits(x,n) ((x) & ((((FbBits) 1) << (n)) - 1)) */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbLeftStipBits(x,n) ((x) & ((((FbStip) 1) << (n)) - 1))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbStipMoveLsb(x,s,n) (FbStipRight (x,(s)-(n)))
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* #define FbLeftBits(x,n) ((x) >> (FB_UNIT - (n))) */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbLeftStipBits(x,n) ((x) >> (FB_STIP_UNIT - (n)))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbRotLeft(x,n) FbScrLeft(x,n) | (n ? FbScrRight(x,FB_UNIT-n) : 0)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbRotRight(x,n) FbScrRight(x,n) | (n ? FbScrLeft(x,FB_UNIT-n) : 0)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbRotStipLeft(x,n) FbStipLeft(x,n) | (n ? FbStipRight(x,FB_STIP_UNIT-n) : 0)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbRotStipRight(x,n) FbStipRight(x,n) | (n ? FbStipLeft(x,FB_STIP_UNIT-n) : 0)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbRightMask(x) ( ((FB_UNIT - (x)) & FB_MASK) ? \
45e9809aff7304721fddb95654901b32195c9c7avboxsync FbScrLeft(FB_ALLONES,(FB_UNIT - (x)) & FB_MASK) : 0)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbLeftStipMask(x) ( ((x) & FB_STIP_MASK) ? \
45e9809aff7304721fddb95654901b32195c9c7avboxsync FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) : 0)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbRightStipMask(x) ( ((FB_STIP_UNIT - (x)) & FB_STIP_MASK) ? \
45e9809aff7304721fddb95654901b32195c9c7avboxsync FbScrLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - (x)) & FB_STIP_MASK) : 0)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbBitsMask(x,w) (FbScrRight(FB_ALLONES,(x) & FB_MASK) & \
45e9809aff7304721fddb95654901b32195c9c7avboxsync FbScrLeft(FB_ALLONES,(FB_UNIT - ((x) + (w))) & FB_MASK))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbStipMask(x,w) (FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) & \
45e9809aff7304721fddb95654901b32195c9c7avboxsync FbStipLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - ((x)+(w))) & FB_STIP_MASK))
45e9809aff7304721fddb95654901b32195c9c7avboxsync r = FbRightMask((x)+n); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync if (n < 0) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbMaskBitsBytes(x,w,copy,l,lb,n,r,rb) FbMaskBits(x,w,l,n,r)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbPatternOffset(o,t) ((o) ^ (FbPatternOffsetBits & ~(sizeof (t) - 1)))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbPtrOffset(p,o,t) ((t *) ((CARD8 *) (p) + (o)))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbSelectPatternPart(xor,o,t) ((xor) >> (FbPatternOffset (o,t) << 3))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbStorePart(dst,off,t,xor) (WRITE(FbPtrOffset(dst,off,t), \
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbSelectPart(x,o,t) FbSelectPatternPart(x,o,t)
45e9809aff7304721fddb95654901b32195c9c7avboxsync r = FbRightMask((x)+n); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* compute right byte length */ \
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* compute left byte length */ \
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* subtract out the portion painted by leftMask */ \
45e9809aff7304721fddb95654901b32195c9c7avboxsync if (n < 0) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync } else if (rb) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 7) | (1 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 7) | (2 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 7) | (3 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 7) | (4 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 7) | (5 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 7) | (6 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 6) | (1 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 6) | (2 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 6) | (3 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 6) | (4 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 6) | (5 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 5) | (1 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 5) | (2 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 5) | (3 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 5) | (4 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 4) | (1 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 4) | (2 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 4) | (3 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync switch (lb) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 3) | (1 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 3) | (2 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync case (sizeof (FbBits) - 2) | (1 << (FB_SHIFT - 3)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, l)); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync switch (rb) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, r)); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync if (n < 0) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync * These macros are used to transparently stipple
45e9809aff7304721fddb95654901b32195c9c7avboxsync * in copy mode; the expected usage is with 'n' constant
45e9809aff7304721fddb95654901b32195c9c7avboxsync * so all of the conditional parts collapse into a minimal
45e9809aff7304721fddb95654901b32195c9c7avboxsync * sequence of partial word writes
45e9809aff7304721fddb95654901b32195c9c7avboxsync * 'n' is the bytemask of which bytes to store, 'a' is the address
45e9809aff7304721fddb95654901b32195c9c7avboxsync * of the FbBits base unit, 'o' is the offset within that unit
45e9809aff7304721fddb95654901b32195c9c7avboxsync * The term "lane" comes from the hardware term "byte-lane" which
45e9809aff7304721fddb95654901b32195c9c7avboxsync if ((n) == 0x01) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync WRITE((CARD8 *) ((a)+FbPatternOffset(o,CARD8)), fgxor); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync if ((n) == 0x03) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync WRITE((CARD16 *) ((a)+FbPatternOffset(o,CARD16)), fgxor); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync if ((n) == 0x0f) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync WRITE((CARD32 *) ((a)+FbPatternOffset(o,CARD32)), fgxor); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync if ((n) == 0x0ff) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbLaneCase(n,a) FbLaneCase8(n,(CARD8 *) (a),0)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbLaneCase(n,a) FbLaneCase4(n,(CARD8 *) (a),0)
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Rotate a filled pixel value to the specified alignement */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbRot24(p,b) (FbScrRight(p,b) | FbScrLeft(p,24-(b)))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbRot24Stip(p,b) (FbStipRight(p,b) | FbStipLeft(p,24-(b)))
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* step a filled pixel value to the next/previous FB_UNIT alignment */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbNext24Stip(p) (FbRot24(p,(24-FB_STIP_UNIT%24)))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbPrev24Stip(p) (FbRot24(p,FB_STIP_UNIT%24))
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* step a rotation value to the next/previous rotation value */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbNext24RotStip(r) ((r) == 0 ? 16 : (r) - 8)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbPrev24RotStip(r) ((r) == 16 ? 0 : (r) + 8)
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Whether 24-bit specific code is needed for this filled pixel value */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Macros for dealing with dashing */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbDashInit(pGC,pPriv,dashOffset,dashlen,even) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* as numInDashList is always even, this case can skip a test */
45e9809aff7304721fddb95654901b32195c9c7avboxsync if (!--(dashlen)) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT DevPrivateKey fbGetGCPrivateKey(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT DevPrivateKey fbGetWinPrivateKey(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Framebuffer access wrapper */
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef FbBits (*ReadMemoryProcPtr)(const void *src, int size);
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*WriteMemoryProcPtr)(void *dst, FbBits value, int size);
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*SetupWrapProcPtr)(ReadMemoryProcPtr *pRead,
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*FinishWrapProcPtr)(DrawablePtr pDraw);
45e9809aff7304721fddb95654901b32195c9c7avboxsync fbGetScreenPrivate((pDraw)->pScreen)->finishWrap(pDraw)
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT DevPrivateKey fbGetScreenPrivateKey(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* private field of a screen */
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned char win32bpp; /* window bpp for 32-bpp images */
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned char pix32bpp; /* pixmap bpp for 32-bpp images */
45e9809aff7304721fddb95654901b32195c9c7avboxsync SetupWrapProcPtr setupWrap; /* driver hook to set pixmap access wrapping */
45e9809aff7304721fddb95654901b32195c9c7avboxsync FinishWrapProcPtr finishWrap; /* driver hook to clean up pixmap access wrapping */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define fbGetScreenPrivate(pScreen) ((FbScreenPrivPtr) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync dixLookupPrivate(&(pScreen)->devPrivates, fbGetScreenPrivateKey()))
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* private field of GC */
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct {
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int dashLength; /* total of all dash elements */
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned char oneRect; /* clip list is single rectangle */
45e9809aff7304721fddb95654901b32195c9c7avboxsync dixLookupPrivate(&(pGC)->devPrivates, fbGetGCPrivateKey()))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define fbGetCompositeClip(pGC) ((pGC)->pCompositeClip)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define fbGetFreeCompClip(pGC) ((pGC)->freeCompClip)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define fbGetRotatedPixmap(pGC) ((pGC)->pRotatedPixmap)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define fbGetScreenPixmap(s) ((PixmapPtr) (s)->devPrivate)
45e9809aff7304721fddb95654901b32195c9c7avboxsync dixLookupPrivate(&((WindowPtr)(pWin))->devPrivates, fbGetWinPrivateKey()))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define __fbPixOffXWin(pPix) (__fbPixDrawableX(pPix) - (pPix)->screen_x)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define __fbPixOffYWin(pPix) (__fbPixDrawableY(pPix) - (pPix)->screen_y)
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define __fbPixOffXWin(pPix) (__fbPixDrawableX(pPix))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define __fbPixOffYWin(pPix) (__fbPixDrawableY(pPix))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define __fbPixOffXPix(pPix) (__fbPixDrawableX(pPix))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define __fbPixOffYPix(pPix) (__fbPixDrawableY(pPix))
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define fbGetDrawablePixmap(pDrawable, pixmap, xoff, yoff) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define fbGetPixmapBitsData(pixmap, pointer, stride, bpp) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync (stride) = ((int) (pixmap)->devKind) / sizeof (FbBits); (void)(stride); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync (bpp) = (pixmap)->drawable.bitsPerPixel; (void)(bpp); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define fbGetPixmapStipData(pixmap, pointer, stride, bpp) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync (stride) = ((int) (pixmap)->devKind) / sizeof (FbStip); (void)(stride); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync (bpp) = (pixmap)->drawable.bitsPerPixel; (void)(bpp); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync fbGetDrawablePixmap(pDrawable, _pPix, xoff, yoff); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync fbGetPixmapBitsData(_pPix, pointer, stride, bpp); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
45e9809aff7304721fddb95654901b32195c9c7avboxsync fbGetDrawablePixmap(pDrawable, _pPix, xoff, yoff); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync fbGetPixmapStipData(_pPix, pointer, stride, bpp); \
45e9809aff7304721fddb95654901b32195c9c7avboxsync * XFree86 empties the root BorderClip when the VT is inactive,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * here's a macro which uses that to disable GetImage and GetSpans
45e9809aff7304721fddb95654901b32195c9c7avboxsync &WindowTable[(pWin)->drawable.pScreen->myNum]->borderClip)
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Accelerated tiles are power of 2 width <= FB_UNIT
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbEvenTile(w) ((w) <= FB_UNIT && FbPowerOfTwo(w))
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Accelerated stipples are power of 2 width and <= FB_UNIT/dstBpp
45e9809aff7304721fddb95654901b32195c9c7avboxsync * with dstBpp a power of 2 as well
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define FbEvenStip(w,bpp) ((w) * (bpp) <= FB_UNIT && FbPowerOfTwo(w) && FbPowerOfTwo(bpp))
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int format,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned long planeMask,
45e9809aff7304721fddb95654901b32195c9c7avboxsyncfb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT DevPrivateKey fbGetWinPrivateKey(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncfbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *pGCIndex);
45e9809aff7304721fddb95654901b32195c9c7avboxsync FbStride srcStride, /* in FbStip units, not FbBits units */
45e9809aff7304721fddb95654901b32195c9c7avboxsync FbStride dstStride, /* in FbStip units, not FbBits units */
45e9809aff7304721fddb95654901b32195c9c7avboxsync FbStride srcStride, /* FbStip units per scanline */
45e9809aff7304721fddb95654901b32195c9c7avboxsync FbStride dstStride, /* FbBits units per scanline */
45e9809aff7304721fddb95654901b32195c9c7avboxsyncfbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps);
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned short *pgreen,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned short *pblue,
45e9809aff7304721fddb95654901b32195c9c7avboxsyncfbSetVisualTypes (int depth, int visuals, int bitsPerRGB);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncfbSetVisualTypesAndMasks (int depth, int visuals, int bitsPerRGB,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned long sizes,
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Compatibility definition, to be removed at next ABI change. */
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*fbCopyProc) (DrawablePtr pSrcDrawable,
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Compatibility wrapper, to be removed at next ABI change. */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Compatibility wrapper, to be removed at next ABI change. */
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned long bitplane);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncfbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable);
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int nglyph,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int nglyph,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int format,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned long planeMask,
45e9809aff7304721fddb95654901b32195c9c7avboxsyncfbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp,
45e9809aff7304721fddb95654901b32195c9c7avboxsyncfbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth,
45e9809aff7304721fddb95654901b32195c9c7avboxsync_fbSetWindowPixmap (WindowPtr pWindow, PixmapPtr pPixmap);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT FbBres fbBresSolid, fbBresDash, fbBresFill, fbBresFillDash;
45e9809aff7304721fddb95654901b32195c9c7avboxsyncfbReduceRasterOp (int rop, FbBits fg, FbBits pm, FbBits *andp, FbBits *xorp);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncfbChangeWindowAttributes(WindowPtr pWin, unsigned long mask);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern _X_EXPORT void free_pixman_pict (PicturePtr, pixman_image_t *);
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* _FB_H_ */