--- pixman/pixman/pixman-compose.c.old 2007-11-28 13:51:37.276456000 +0800 +++ pixman/pixman/pixman-compose.c 2007-11-28 14:42:27.849065000 +0800 @@ -33,6 +33,10 @@ #include #include +#ifdef USE_MEDIALIB +#include +#endif + #include "pixman-private.h" /* @@ -4456,6 +4460,12 @@ if (fetchMask) mask_buffer = dest_buffer + data->width; +#ifdef USE_MEDIALIB + if (fetchMask || xoff || store || yoff || + data->xDest || data->xSrc || data->yDest || data->ySrc || + ((compose != fbCombineSrcU) && (compose != fbCombineOverU)) + ) { +#endif for (i = 0; i < data->height; ++i) { /* fill first half of scanline with source */ @@ -4533,6 +4543,32 @@ src_mask_buffer, data->width); } } +#ifdef USE_MEDIALIB + } + /* fetchmask = NULL */ + else { + mlib_image *m_src; + mlib_image *m_dst; + + m_src = mlib_ImageCreateStruct(MLIB_BYTE, 4, + pixman_image_get_width(data->src), + pixman_image_get_height(data->src), + pixman_image_get_stride(data->src), + pixman_image_get_data(data->src)); + + m_dst = mlib_ImageCreateStruct(MLIB_BYTE ,4, + pixman_image_get_width(data->dest), + pixman_image_get_height(data->dest), + pixman_image_get_stride(data->dest), + pixman_image_get_data(data->dest)); + if ((data->src->bits.format != PIXMAN_x8r8g8b8) && (compose == fbCombineOverU)) + mlib_ImageBlend_OMSA_ONE_Inp(m_dst, m_src, 0x08); + else + mlib_ImageBlend_ZERO_ONE_Inp(m_dst, m_src, 0x08); + mlib_ImageDelete(m_src); + mlib_ImageDelete(m_dst); + } +#endif } if (!store) --- pixman/pixman/pixman-utils.c.old 2007-11-28 13:51:58.673536000 +0800 +++ pixman/pixman/pixman-utils.c 2007-11-28 13:55:55.912632000 +0800 @@ -25,6 +25,10 @@ #include #endif +#ifdef USE_MEDIALIB +#include +#endif + #include #include "pixman.h" #include "pixman-private.h" @@ -145,8 +149,22 @@ { int i; +#ifdef USE_MEDIALIB + mlib_image *m_img; + mlib_s32 color[4]; +#endif + bits = bits + y * stride + x; +#ifdef USE_MEDIALIB + color[3] = xor & 0xff; + color[2] = (xor & 0xff00) >> 8; + color[1] = (xor & 0xff0000) >> 16; + color[0] = (xor & 0xff000000) >> 24; + m_img = mlib_ImageCreateStruct(MLIB_BYTE, 4, width, height, stride*4, bits); + mlib_ImageClear(m_img, color); + mlib_ImageDelete(m_img); +#else while (height--) { for (i = 0; i < width; ++i) @@ -154,6 +172,7 @@ bits += stride; } +#endif } pixman_bool_t --- pixman/configure.ac.old 2007-11-28 13:52:16.360921000 +0800 +++ pixman/configure.ac 2007-11-28 13:55:00.800179000 +0800 @@ -54,6 +54,7 @@ AC_PROG_CC AC_PROG_LIBTOOL AC_CHECK_FUNCS([getisax]) +AC_CHECK_HEADER([mlib.h],[AC_DEFINE([USE_MEDIALIB],[1],[mediaLib Libraries]) LIBS="-lmlib $LIBS"]) AC_C_BIGENDIAN #