📄 icint.h
字号:
FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \ break; \ case (sizeof (FbBits) - 5): \ FbStorePart(dst,sizeof (FbBits) - 5,CARD8,xor); \ FbStorePart(dst,sizeof (FbBits) - 4,CARD32,xor); \ break; \ case (sizeof (FbBits) - 4) | (1 << (FB_SHIFT - 3)): \ FbStorePart(dst,sizeof (FbBits) - 4,CARD8,xor); \ break; \ case (sizeof (FbBits) - 4) | (2 << (FB_SHIFT - 3)): \ FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \ break; \ case (sizeof (FbBits) - 4) | (3 << (FB_SHIFT - 3)): \ FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \ FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \ break; \ case (sizeof (FbBits) - 4): \ FbStorePart(dst,sizeof (FbBits) - 4,CARD32,xor); \ break;#define FbDoRightMaskByteRRop6Cases(dst,xor) \ case 4: \ FbStorePart(dst,0,CARD32,xor); \ break; \ case 5: \ FbStorePart(dst,0,CARD32,xor); \ FbStorePart(dst,4,CARD8,xor); \ break; \ case 6: \ FbStorePart(dst,0,CARD32,xor); \ FbStorePart(dst,4,CARD16,xor); \ break; \ case 7: \ FbStorePart(dst,0,CARD32,xor); \ FbStorePart(dst,4,CARD16,xor); \ FbStorePart(dst,6,CARD8,xor); \ break;#else#define FbDoLeftMaskByteRRop6Cases(dst,xor)#define FbDoRightMaskByteRRop6Cases(dst,xor)#endif#define FbDoLeftMaskByteRRop(dst,lb,l,and,xor) { \ switch (lb) { \ FbDoLeftMaskByteRRop6Cases(dst,xor) \ case (sizeof (FbBits) - 3) | (1 << (FB_SHIFT - 3)): \ FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \ break; \ case (sizeof (FbBits) - 3) | (2 << (FB_SHIFT - 3)): \ FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \ FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \ break; \ case (sizeof (FbBits) - 2) | (1 << (FB_SHIFT - 3)): \ FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \ break; \ case sizeof (FbBits) - 3: \ FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \ case sizeof (FbBits) - 2: \ FbStorePart(dst,sizeof (FbBits) - 2,CARD16,xor); \ break; \ case sizeof (FbBits) - 1: \ FbStorePart(dst,sizeof (FbBits) - 1,CARD8,xor); \ break; \ default: \ *dst = FbDoMaskRRop(*dst, and, xor, l); \ break; \ } \}#define FbDoRightMaskByteRRop(dst,rb,r,and,xor) { \ switch (rb) { \ case 1: \ FbStorePart(dst,0,CARD8,xor); \ break; \ case 2: \ FbStorePart(dst,0,CARD16,xor); \ break; \ case 3: \ FbStorePart(dst,0,CARD16,xor); \ FbStorePart(dst,2,CARD8,xor); \ break; \ FbDoRightMaskByteRRop6Cases(dst,xor) \ default: \ *dst = FbDoMaskRRop (*dst, and, xor, r); \ } \}#endif#define FbMaskStip(x,w,l,n,r) { \ n = (w); \ r = FbRightStipMask((x)+n); \ l = FbLeftStipMask(x); \ if (l) { \ n -= FB_STIP_UNIT - ((x) & FB_STIP_MASK); \ if (n < 0) { \ n = 0; \ l &= r; \ r = 0; \ } \ } \ n >>= FB_STIP_SHIFT; \}/* * These macros are used to transparently stipple * in copy mode; the expected usage is with 'n' constant * so all of the conditional parts collapse into a minimal * sequence of partial word writes * * 'n' is the bytemask of which bytes to store, 'a' is the address * of the FbBits base unit, 'o' is the offset within that unit * * The term "lane" comes from the hardware term "byte-lane" which */#define FbLaneCase1(n,a,o) ((n) == 0x01 ? \ (*(CARD8 *) ((a)+FbPatternOffset(o,CARD8)) = \ fgxor) : 0)#define FbLaneCase2(n,a,o) ((n) == 0x03 ? \ (*(CARD16 *) ((a)+FbPatternOffset(o,CARD16)) = \ fgxor) : \ ((void)FbLaneCase1((n)&1,a,o), \ FbLaneCase1((n)>>1,a,(o)+1)))#define FbLaneCase4(n,a,o) ((n) == 0x0f ? \ (*(CARD32 *) ((a)+FbPatternOffset(o,CARD32)) = \ fgxor) : \ ((void)FbLaneCase2((n)&3,a,o), \ FbLaneCase2((n)>>2,a,(o)+2)))#define FbLaneCase8(n,a,o) ((n) == 0x0ff ? (*(FbBits *) ((a)+(o)) = fgxor) : \ ((void)FbLaneCase4((n)&15,a,o), \ FbLaneCase4((n)>>4,a,(o)+4)))#if FB_SHIFT == 6#define FbLaneCase(n,a) FbLaneCase8(n,(CARD8 *) (a),0)#endif#if FB_SHIFT == 5#define FbLaneCase(n,a) FbLaneCase4(n,(CARD8 *) (a),0)#endif/* Rotate a filled pixel value to the specified alignement */#define FbRot24(p,b) (FbScrRight(p,b) | FbScrLeft(p,24-(b)))#define FbRot24Stip(p,b) (FbStipRight(p,b) | FbStipLeft(p,24-(b)))/* step a filled pixel value to the next/previous FB_UNIT alignment */#define FbNext24Pix(p) (FbRot24(p,(24-FB_UNIT%24)))#define FbPrev24Pix(p) (FbRot24(p,FB_UNIT%24))#define FbNext24Stip(p) (FbRot24(p,(24-FB_STIP_UNIT%24)))#define FbPrev24Stip(p) (FbRot24(p,FB_STIP_UNIT%24))/* step a rotation value to the next/previous rotation value */#if FB_UNIT == 64#define FbNext24Rot(r) ((r) == 16 ? 0 : (r) + 8)#define FbPrev24Rot(r) ((r) == 0 ? 16 : (r) - 8)#if IMAGE_BYTE_ORDER == MSBFirst#define FbFirst24Rot(x) (((x) + 8) % 24)#else#define FbFirst24Rot(x) ((x) % 24)#endif#endif#if FB_UNIT == 32#define FbNext24Rot(r) ((r) == 0 ? 16 : (r) - 8)#define FbPrev24Rot(r) ((r) == 16 ? 0 : (r) + 8)#if IMAGE_BYTE_ORDER == MSBFirst#define FbFirst24Rot(x) (((x) + 16) % 24)#else#define FbFirst24Rot(x) ((x) % 24)#endif#endif#define FbNext24RotStip(r) ((r) == 0 ? 16 : (r) - 8)#define FbPrev24RotStip(r) ((r) == 16 ? 0 : (r) + 8)/* Whether 24-bit specific code is needed for this filled pixel value */#define FbCheck24Pix(p) ((p) == FbNext24Pix(p))#define FbGetPixels(icpixels, pointer, _stride_, _bpp_, xoff, yoff) { \ (pointer) = icpixels->data; \ (_stride_) = icpixels->stride / sizeof(pixman_bits_t); \ (_bpp_) = icpixels->bpp; \ (xoff) = icpixels->x; /* XXX: fb.h had this ifdef'd to constant 0. Why? */ \ (yoff) = icpixels->y; /* XXX: fb.h had this ifdef'd to constant 0. Why? */ \}#define FbGetStipPixels(icpixels, pointer, _stride_, _bpp_, xoff, yoff) { \ (pointer) = (FbStip *) icpixels->data; \ (_stride_) = icpixels->stride / sizeof(FbStip); \ (_bpp_) = icpixels->bpp; \ (xoff) = icpixels->x; \ (yoff) = icpixels->y; \}#ifdef FB_OLD_SCREEN#define BitsPerPixel(d) (\ ((1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \ (PixmapWidthPaddingInfo[d].padRoundUp+1)))#endif#define FbPowerOfTwo(w) (((w) & ((w) - 1)) == 0)/* * Accelerated tiles are power of 2 width <= FB_UNIT */#define FbEvenTile(w) ((w) <= FB_UNIT && FbPowerOfTwo(w))/* * Accelerated stipples are power of 2 width and <= FB_UNIT/dstBpp * with dstBpp a power of 2 as well */#define FbEvenStip(w,bpp) ((w) * (bpp) <= FB_UNIT && FbPowerOfTwo(w) && FbPowerOfTwo(bpp))/* * icblt.c */pixman_private voidfbBlt (pixman_bits_t *src, FbStride srcStride, int srcX, FbBits *dst, FbStride dstStride, int dstX, int width, int height, int alu, FbBits pm, int bpp, Bool reverse, Bool upsidedown);pixman_private voidfbBlt24 (pixman_bits_t *srcLine, FbStride srcStride, int srcX, FbBits *dstLine, FbStride dstStride, int dstX, int width, int height, int alu, FbBits pm, Bool reverse, Bool upsidedown);pixman_private voidfbBltStip (FbStip *src, FbStride srcStride, /* in FbStip units, not FbBits units */ int srcX, FbStip *dst, FbStride dstStride, /* in FbStip units, not FbBits units */ int dstX, int width, int height, int alu, FbBits pm, int bpp);/* * icbltone.c */pixman_private voidfbBltOne (FbStip *src, FbStride srcStride, int srcX, FbBits *dst, FbStride dstStride, int dstX, int dstBpp, int width, int height, FbBits fgand, FbBits fbxor, FbBits bgand, FbBits bgxor);#ifdef FB_24BITpixman_private voidfbBltOne24 (FbStip *src, FbStride srcStride, /* FbStip units per scanline */ int srcX, /* bit position of source */ FbBits *dst, FbStride dstStride, /* FbBits units per scanline */ int dstX, /* bit position of dest */ int dstBpp, /* bits per destination unit */ int width, /* width in bits of destination */ int height, /* height in scanlines */ FbBits fgand, /* rrop values */ FbBits fgxor, FbBits bgand, FbBits bgxor);#endif/* * icstipple.c */pixman_private voidfbTransparentSpan (pixman_bits_t *dst, pixman_bits_t stip, pixman_bits_t fgxor, int n);pixman_private voidfbEvenStipple (pixman_bits_t *dst, FbStride dstStride, int dstX, int dstBpp, int width, int height, FbStip *stip, FbStride stipStride, int stipHeight, FbBits fgand, FbBits fgxor, FbBits bgand, FbBits bgxor, int xRot, int yRot);pixman_private voidfbOddStipple (pixman_bits_t *dst, FbStride dstStride, int dstX, int dstBpp, int width, int height, FbStip *stip, FbStride stipStride, int stipWidth, int stipHeight, FbBits fgand, FbBits fgxor, FbBits bgand, FbBits bgxor, int xRot, int yRot);pixman_private voidfbStipple (pixman_bits_t *dst, FbStride dstStride, int dstX, int dstBpp, int width,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -