From 658acaad4e73ac705f705f947a42a2cd0979042c Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Wed, 20 Jun 2007 11:36:22 -0400 Subject: [PATCH] Add fbCompositeSrc_8888xx888(); comment out fbCompositeOver_x888x8x8888{mmx} since they are not actually faster than the generic code. --- pixman/pixman-pict.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/pixman/pixman-pict.c b/pixman/pixman-pict.c index 57bd7d6..8886c0c 100644 --- a/pixman/pixman-pict.c +++ b/pixman/pixman-pict.c @@ -1048,6 +1048,40 @@ fbCompositeSolidFill (pixman_op_t op, } static void +fbCompositeSrc_8888xx888 (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 *dst; + uint32_t *src; + int dstStride, srcStride; + uint32_t n_bytes = width * sizeof (uint32_t); + + fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, src, 1); + fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dst, 1); + + while (height--) + { + memcpy (dst, src, n_bytes); + + dst += dstStride; + src += srcStride; + } + + fbFinishAccess(pSrc->pDrawable); + fbFinishAccess(pDst->pDrawable); +} + +static void pixman_walk_composite_region (pixman_op_t op, pixman_image_t * pSrc, pixman_image_t * pMask, @@ -1509,6 +1543,10 @@ pixman_image_composite (pixman_op_t op, } else { +#if 0 + /* FIXME: This code is commented out since it's apparently not + * actually faster than the generic code. + */ if (pMask->bits.format == PIXMAN_a8) { if ((pSrc->bits.format == PIXMAN_x8r8g8b8 && @@ -1526,6 +1564,7 @@ pixman_image_composite (pixman_op_t op, func = fbCompositeOver_x888x8x8888; } } +#endif } } } @@ -1804,6 +1843,15 @@ pixman_image_composite (pixman_op_t op, #endif ; } + else if (((pSrc->bits.format == PIXMAN_a8r8g8b8 || + pSrc->bits.format == PIXMAN_x8r8g8b8) && + pDst->bits.format == PIXMAN_x8r8g8b8) || + ((pSrc->bits.format == PIXMAN_a8b8g8r8 || + pSrc->bits.format == PIXMAN_x8b8g8r8) && + pDst->bits.format == PIXMAN_x8b8g8r8)) + { + func = fbCompositeSrc_8888xx888; + } } break; case PIXMAN_OP_IN: -- 2.7.4