From: Søren Sandmann Pedersen Date: Mon, 18 Jun 2007 02:57:47 +0000 (-0400) Subject: Add new fbCompositeOver_x888x8x8888mmx() operation X-Git-Tag: 1.0_branch~1472 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=80a61bfb3dcf26271766e36aa31d454889ee43a5;p=profile%2Fivi%2Fpixman.git Add new fbCompositeOver_x888x8x8888mmx() operation --- diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c index 8025150..39efbba 100644 --- a/pixman/pixman-mmx.c +++ b/pixman/pixman-mmx.c @@ -2929,4 +2929,70 @@ fbCompositeCopyAreammx (pixman_op_t op, xSrc, ySrc, xDst, yDst, width, height); } +void +fbCompositeOver_x888x8x8888mmx (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, *srcLine; + uint32_t *dst, *dstLine; + uint8_t *mask, *maskLine; + int srcStride, maskStride, dstStride; + __m64 m; + uint32_t s, d; + uint16_t w; + + fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); + fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1); + fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1); + + while (height--) + { + src = srcLine; + srcLine += srcStride; + dst = dstLine; + dstLine += dstStride; + mask = maskLine; + maskLine += maskStride; + + w = width; + + while (w--) + { + ullong m = *mask; + + if (m) + { + __m64 s = load8888 (*src); + + if (m == 0xff) + *dst = store8888 (s); + else + { + __m64 sa = expand_alpha (s); + __m64 vm = expand_alpha_rev ((__m64)m); + __m64 vdest = in_over(s, sa, vm, load8888 (*dst)); + } + } + + mask++; + dst++; + src++; + } + } + + _mm_empty(); +} + + + #endif /* USE_MMX */ diff --git a/pixman/pixman-mmx.h b/pixman/pixman-mmx.h index c666f43..044e776 100644 --- a/pixman/pixman-mmx.h +++ b/pixman/pixman-mmx.h @@ -311,5 +311,18 @@ fbCompositeSolidFillmmx (pixman_op_t op, int16_t yDst, uint16_t width, uint16_t height); +void +fbCompositeOver_x888x8x8888mmx (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); #endif /* USE_MMX */ diff --git a/pixman/pixman-pict.c b/pixman/pixman-pict.c index f2d5d0a..bd4c1f1 100644 --- a/pixman/pixman-pict.c +++ b/pixman/pixman-pict.c @@ -1470,7 +1470,12 @@ pixman_image_composite (pixman_op_t op, (pDst->bits.format == PIXMAN_a8r8g8b8 || pDst->bits.format == PIXMAN_x8r8g8b8)) { - func = fbCompositeOver_x888x8x8888; +#ifdef USE_MMX + if (pixman_have_mmx()) + func = fbCompositeOver_x888x8x8888mmx; + else +#endif + func = fbCompositeOver_x888x8x8888; } } }