📄 pixman-pict.c
字号:
uint8_t *maskLine, *mask, m; int dstStride, maskStride; uint16_t w; fbComposeGetSolid(pSrc, src, pDst->bits.format); srca = src >> 24; if (src == 0) return; fbComposeGetStart (pDst, xDst, yDst, uint16_t, dstStride, dstLine, 1); fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1); while (height--) { dst = dstLine; dstLine += dstStride; mask = maskLine; maskLine += maskStride; w = width; while (w--) { m = READ(pMask, mask++); if (m == 0xff) { if (srca == 0xff) d = src; else { d = READ(pDst, dst); d = fbOver24 (src, cvt0565to0888(d)); } WRITE(pDst, dst, cvt8888to0565(d)); } else if (m) { d = READ(pDst, dst); d = fbOver24 (fbIn(src,m), cvt0565to0888(d)); WRITE(pDst, dst, cvt8888to0565(d)); } dst++; } }}voidfbCompositeSolidMask_nx8888x0565C (pixman_op_t op, pixman_image_t * pSrc, pixman_image_t * pMask, pixman_image_t * pDst, int16_t xSrc, int16_t ySrc, int16_t xMask, int16_t yMask, int16_t xDst, int16_t yDst, uint16_t width, uint16_t height){ uint32_t src, srca; uint16_t src16; uint16_t *dstLine, *dst; uint32_t d; uint32_t *maskLine, *mask, ma; int dstStride, maskStride; uint16_t w; uint32_t m, n, o; fbComposeGetSolid(pSrc, src, pDst->bits.format); srca = src >> 24; if (src == 0) return; src16 = cvt8888to0565(src); fbComposeGetStart (pDst, xDst, yDst, uint16_t, dstStride, dstLine, 1); fbComposeGetStart (pMask, xMask, yMask, uint32_t, maskStride, maskLine, 1); while (height--) { dst = dstLine; dstLine += dstStride; mask = maskLine; maskLine += maskStride; w = width; while (w--) { ma = READ(pMask, mask++); if (ma == 0xffffffff) { if (srca == 0xff) { WRITE(pDst, dst, src16); } else { d = READ(pDst, dst); d = fbOver24 (src, cvt0565to0888(d)); WRITE(pDst, dst, cvt8888to0565(d)); } } else if (ma) { d = READ(pDst, dst); d = cvt0565to0888(d); FbInOverC (src, srca, ma, d, 0, m); FbInOverC (src, srca, ma, d, 8, n); FbInOverC (src, srca, ma, d, 16, o); d = m|n|o; WRITE(pDst, dst, cvt8888to0565(d)); } dst++; } }}voidfbCompositeSrc_8888x8888 (pixman_op_t op, pixman_image_t * pSrc, pixman_image_t * pMask, pixman_image_t * pDst, int16_t xSrc, int16_t ySrc, int16_t xMask, int16_t yMask, int16_t xDst, int16_t yDst, uint16_t width, uint16_t height){ uint32_t *dstLine, *dst, dstMask; uint32_t *srcLine, *src, s; int dstStride, srcStride; uint8_t a; uint16_t w; fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1); dstMask = FbFullMask (PIXMAN_FORMAT_DEPTH (pDst->bits.format)); while (height--) { dst = dstLine; dstLine += dstStride; src = srcLine; srcLine += srcStride; w = width; while (w--) { s = READ(pSrc, src++); a = s >> 24; if (a == 0xff) WRITE(pDst, dst, s & dstMask); else if (a) WRITE(pDst, dst, fbOver (s, READ(pDst, dst)) & dstMask); dst++; } }}voidfbCompositeSrc_8888x0888 (pixman_op_t op, pixman_image_t * pSrc, pixman_image_t * pMask, pixman_image_t * pDst, int16_t xSrc, int16_t ySrc, int16_t xMask, int16_t yMask, int16_t xDst, int16_t yDst, uint16_t width, uint16_t height){ uint8_t *dstLine, *dst; uint32_t d; uint32_t *srcLine, *src, s; uint8_t a; int dstStride, srcStride; uint16_t w; fbComposeGetStart (pDst, xDst, yDst, uint8_t, dstStride, dstLine, 3); fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1); while (height--) { dst = dstLine; dstLine += dstStride; src = srcLine; srcLine += srcStride; w = width; while (w--) { s = READ(pSrc, src++); a = s >> 24; if (a) { if (a == 0xff) d = s; else d = fbOver24 (s, Fetch24(pDst, dst)); Store24(pDst, dst, d); } dst += 3; } }}voidfbCompositeSrc_8888x0565 (pixman_op_t op, pixman_image_t * pSrc, pixman_image_t * pMask, pixman_image_t * pDst, int16_t xSrc, int16_t ySrc, int16_t xMask, int16_t yMask, int16_t xDst, int16_t yDst, uint16_t width, uint16_t height){ uint16_t *dstLine, *dst; uint32_t d; uint32_t *srcLine, *src, s; uint8_t a; int dstStride, srcStride; uint16_t w; fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1); fbComposeGetStart (pDst, xDst, yDst, uint16_t, dstStride, dstLine, 1); while (height--) { dst = dstLine; dstLine += dstStride; src = srcLine; srcLine += srcStride; w = width; while (w--) { s = READ(pSrc, src++); a = s >> 24; if (a) { if (a == 0xff) d = s; else { d = READ(pDst, dst); d = fbOver24 (s, cvt0565to0888(d)); } WRITE(pDst, dst, cvt8888to0565(d)); } dst++; } }}voidfbCompositeSrcAdd_8000x8000 (pixman_op_t op, pixman_image_t * pSrc, pixman_image_t * pMask, pixman_image_t * pDst, int16_t xSrc, int16_t ySrc, int16_t xMask, int16_t yMask, int16_t xDst, int16_t yDst, uint16_t width, uint16_t height){ uint8_t *dstLine, *dst; uint8_t *srcLine, *src; int dstStride, srcStride; uint16_t w; uint8_t s, d; uint16_t t; fbComposeGetStart (pSrc, xSrc, ySrc, uint8_t, srcStride, srcLine, 1); fbComposeGetStart (pDst, xDst, yDst, uint8_t, dstStride, dstLine, 1); while (height--) { dst = dstLine; dstLine += dstStride; src = srcLine; srcLine += srcStride; w = width; while (w--) { s = READ(pSrc, src++); if (s) { if (s != 0xff) { d = READ(pDst, dst); t = d + s; s = t | (0 - (t >> 8)); } WRITE(pDst, dst, s); } dst++; } }}voidfbCompositeSrcAdd_8888x8888 (pixman_op_t op, pixman_image_t * pSrc, pixman_image_t * pMask, pixman_image_t * pDst, int16_t xSrc, int16_t ySrc, int16_t xMask, int16_t yMask, int16_t xDst, int16_t yDst, uint16_t width, uint16_t height){ uint32_t *dstLine, *dst; uint32_t *srcLine, *src; int dstStride, srcStride; uint16_t w; uint32_t s, d; uint16_t t; uint32_t m,n,o,p; fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1); fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); while (height--) { dst = dstLine; dstLine += dstStride; src = srcLine; srcLine += srcStride; w = width; while (w--) { s = READ(pSrc, src++); if (s) { if (s != 0xffffffff) { d = READ(pDst, dst); if (d) { m = FbAdd(s,d,0,t); n = FbAdd(s,d,8,t); o = FbAdd(s,d,16,t); p = FbAdd(s,d,24,t); s = m|n|o|p; } } WRITE(pDst, dst, s); } dst++; } }}static voidfbCompositeSrcAdd_8888x8x8 (pixman_op_t op, pixman_image_t * pSrc, pixman_image_t * pMask, pixman_image_t * pDst, int16_t xSrc, int16_t ySrc, int16_t xMask, int16_t yMask, int16_t xDst, int16_t yDst, uint16_t width, uint16_t height){ uint8_t *dstLine, *dst; uint8_t *maskLine, *mask; int dstStride, maskStride; uint16_t w; uint32_t src; uint8_t sa; fbComposeGetStart (pDst, xDst, yDst, uint8_t, dstStride, dstLine, 1); fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1); fbComposeGetSolid (pSrc, src, pDst->bits.format); sa = (src >> 24); while (height--) { dst = dstLine; dstLine += dstStride; mask = maskLine; maskLine += maskStride; w = width; while (w--) { uint16_t tmp; uint16_t a; uint32_t m, d; uint32_t r; a = READ(pMask, mask++); d = READ(pDst, dst); m = FbInU (sa, 0, a, tmp); r = FbAdd (m, d, 0, tmp); WRITE(pDst, dst++, r); } }}voidfbCompositeSrcAdd_1000x1000 (pixman_op_t op, pixman_image_t * pSrc, pixman_image_t * pMask, pixman_image_t * pDst, int16_t xSrc, int16_t ySrc, int16_t xMask, int16_t yMask, int16_t xDst, int16_t yDst, uint16_t width, uint16_t height){ /* FIXME */#if 0 uint32_t *dstBits, *srcBits; int dstStride, srcStride; int dstBpp, srcBpp; int dstXoff, dstYoff; int srcXoff, srcYoff; fbGetDrawable(pSrc->pDrawable, srcBits, srcStride, srcBpp, srcXoff, srcYoff); fbGetDrawable(pDst->pDrawable, dstBits, dstStride, dstBpp, dstXoff, dstYoff); fbBlt (srcBits + srcStride * (ySrc + srcYoff), srcStride, xSrc + srcXoff, dstBits + dstStride * (yDst + dstYoff), dstStride, xDst + dstXoff, width, height, GXor, FB_ALLONES, srcBpp, FALSE, FALSE);#endif}voidfbCompositeSolidMask_nx1xn (pixman_op_t op, pixman_image_t * pSrc, pixman_image_t * pMask, pixman_image_t * pDst, int16_t xSrc, int16_t ySrc, int16_t xMask, int16_t yMask, int16_t xDst, int16_t yDst, uint16_t width, uint16_t height){ /* FIXME */#if 0 uint32_t *dstBits; uint32_t *maskBits; int dstStride, maskStride; int dstBpp, maskBpp;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -