From: Søren Sandmann Pedersen Date: Fri, 22 May 2009 12:04:38 +0000 (-0400) Subject: Get rid of the StoreExternalAlpha() functions X-Git-Tag: 1.0_branch~1082^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0486f0f3241225c887549def31e5e246ff16255f;p=profile%2Fivi%2Fpixman.git Get rid of the StoreExternalAlpha() functions --- diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c index f1f224c..ccaf07b 100644 --- a/pixman/pixman-bits-image.c +++ b/pixman/pixman-bits-image.c @@ -90,7 +90,7 @@ fbFetch64(bits_image_t * image, } static void -fbStore(bits_image_t * image, int x, int y, int width, uint32_t *buffer) +bits_image_store_scanline_32 (bits_image_t *image, int x, int y, int width, uint32_t *buffer) { uint32_t *bits; int32_t stride; @@ -101,10 +101,18 @@ fbStore(bits_image_t * image, int x, int y, int width, uint32_t *buffer) bits += y*stride; image->store_scanline_raw_32 ((pixman_image_t *)image, bits, buffer, x, width, indexed); + + if (image->common.alpha_map) + { + x -= image->common.alpha_origin.x; + y -= image->common.alpha_origin.y; + + bits_image_store_scanline_32 (image->common.alpha_map, x, y, width, buffer); + } } static void -fbStore64 (bits_image_t * image, int x, int y, int width, uint64_t *buffer) +bits_image_store_scanline_64 (bits_image_t *image, int x, int y, int width, uint32_t *buffer) { uint32_t *bits; int32_t stride; @@ -113,7 +121,16 @@ fbStore64 (bits_image_t * image, int x, int y, int width, uint64_t *buffer) bits = image->bits; stride = image->rowstride; bits += y*stride; - image->store_scanline_raw_64 ((pixman_image_t *)image, bits, buffer, x, width, indexed); + + image->store_scanline_raw_64 ((pixman_image_t *)image, bits, (uint64_t *)buffer, x, width, indexed); + + if (image->common.alpha_map) + { + x -= image->common.alpha_origin.x; + y -= image->common.alpha_origin.y; + + bits_image_store_scanline_64 (image->common.alpha_map, x, y, width, buffer); + } } /* On entry, @buffer should contain @n_pixels (x, y) coordinate pairs, where @@ -209,73 +226,6 @@ _pixman_image_fetch_pixels (bits_image_t *image, uint32_t *buffer, int n_pixels) } static void -fbStoreExternalAlpha (bits_image_t * image, int x, int y, int width, - uint32_t *buffer) -{ - uint32_t *bits, *alpha_bits; - int32_t stride, astride; - int ax, ay; - const pixman_indexed_t * indexed = image->indexed; - const pixman_indexed_t * aindexed; - - if (!image->common.alpha_map) { - // XXX[AGP]: This should never happen! - // fbStore(image, x, y, width, buffer); - abort(); - return; - } - - aindexed = image->common.alpha_map->indexed; - - ax = x; - ay = y; - - bits = image->bits; - stride = image->rowstride; - - alpha_bits = image->common.alpha_map->bits; - astride = image->common.alpha_map->rowstride; - - bits += y*stride; - alpha_bits += (ay - image->common.alpha_origin.y)*astride; - - - image->store_scanline_raw_32((pixman_image_t *)image, bits, buffer, x, width, indexed); - image->common.alpha_map->store_scanline_raw_32 ((pixman_image_t *)image->common.alpha_map, - alpha_bits, buffer, ax - image->common.alpha_origin.x, width, aindexed); -} - -static void -fbStoreExternalAlpha64 (bits_image_t * image, int x, int y, int width, - uint64_t *buffer) -{ - uint32_t *bits, *alpha_bits; - int32_t stride, astride; - int ax, ay; - const pixman_indexed_t * indexed = image->indexed; - const pixman_indexed_t * aindexed; - - aindexed = image->common.alpha_map->indexed; - - ax = x; - ay = y; - - bits = image->bits; - stride = image->rowstride; - - alpha_bits = image->common.alpha_map->bits; - astride = image->common.alpha_map->rowstride; - - bits += y*stride; - alpha_bits += (ay - image->common.alpha_origin.y)*astride; - - - image->store_scanline_raw_64((pixman_image_t *)image, bits, buffer, x, width, indexed); - image->common.alpha_map->store_scanline_raw_64((pixman_image_t *)image->common.alpha_map, - alpha_bits, buffer, ax - image->common.alpha_origin.x, width, aindexed); -} - -static void fetch_pixels_src_clip (bits_image_t *image, uint32_t *buffer, int n_pixels) { if (image->common.src_clip != &(image->common.full_region) && @@ -778,16 +728,8 @@ bits_image_property_changed (pixman_image_t *image) (scanFetchProc)fbFetchTransformed; } - if (bits->common.alpha_map) - { - bits->store_scanline_64 = (scanStoreProc)fbStoreExternalAlpha64; - bits->store_scanline_32 = fbStoreExternalAlpha; - } - else - { - bits->store_scanline_64 = (scanStoreProc)fbStore64; - bits->store_scanline_32 = fbStore; - } + bits->store_scanline_64 = bits_image_store_scanline_64; + bits->store_scanline_32 = bits_image_store_scanline_32; bits->store_scanline_raw_32 = WRITE_ACCESS(pixman_storeProcForPicture32)(bits); @@ -802,6 +744,7 @@ bits_image_property_changed (pixman_image_t *image) bits->fetch_pixel = READ_ACCESS(pixman_fetchPixelProcForPicture32)(bits); } + void _pixman_image_store_scanline_32 (bits_image_t *image, int x, int y, int width, uint32_t *buffer)