From: Søren Sandmann Pedersen Date: Sun, 3 May 2009 02:26:23 +0000 (-0400) Subject: Store get_scanline() functions in the image struct X-Git-Tag: 1.0_branch~1167 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c62f2a14f433a07c5333cfefeed934214507d63a;p=profile%2Fivi%2Fpixman.git Store get_scanline() functions in the image struct --- diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c index 42362eb..d0bf102 100644 --- a/pixman/pixman-image.c +++ b/pixman/pixman-image.c @@ -139,16 +139,13 @@ static void fbFetch64(bits_image_t * image, int x, int y, int width, uint64_t *b fetch(image, x, y, width, buffer); } -scanFetchProc -_pixman_image_get_fetcher (pixman_image_t *image, - int wide) +static void +set_fetchers (pixman_image_t *image) { if (IS_SOURCE_IMAGE (image)) { - if (wide) - return (scanFetchProc)pixmanFetchSourcePict64; - else - return (scanFetchProc)pixmanFetchSourcePict; + image->common.get_scanline_64 = (scanFetchProc)pixmanFetchSourcePict64; + image->common.get_scanline_32 = (scanFetchProc)pixmanFetchSourcePict; } else { @@ -156,38 +153,45 @@ _pixman_image_get_fetcher (pixman_image_t *image, if (bits->common.alpha_map) { - if (wide) - return (scanFetchProc)READ_ACCESS(fbFetchExternalAlpha64); - else - return (scanFetchProc)READ_ACCESS(fbFetchExternalAlpha); + image->common.get_scanline_64 = + (scanFetchProc)READ_ACCESS(fbFetchExternalAlpha64); + image->common.get_scanline_32 = + (scanFetchProc)READ_ACCESS(fbFetchExternalAlpha); } else if ((bits->common.repeat != PIXMAN_REPEAT_NONE) && bits->width == 1 && bits->height == 1) { - if (wide) - return (scanFetchProc)fbFetchSolid64; - else - return (scanFetchProc)fbFetchSolid; + image->common.get_scanline_64 = (scanFetchProc)fbFetchSolid64; + image->common.get_scanline_32 = (scanFetchProc)fbFetchSolid; } - else if (!bits->common.transform && bits->common.filter != PIXMAN_FILTER_CONVOLUTION - && bits->common.repeat != PIXMAN_REPEAT_PAD && bits->common.repeat != PIXMAN_REPEAT_REFLECT) + else if (!bits->common.transform && + bits->common.filter != PIXMAN_FILTER_CONVOLUTION && + bits->common.repeat != PIXMAN_REPEAT_PAD && + bits->common.repeat != PIXMAN_REPEAT_REFLECT) { - if (wide) - return (scanFetchProc)fbFetch64; - else - return (scanFetchProc)fbFetch; + image->common.get_scanline_64 = (scanFetchProc)fbFetch64; + image->common.get_scanline_32 = (scanFetchProc)fbFetch; } else { - if (wide) - return (scanFetchProc)READ_ACCESS(fbFetchTransformed64); - else - return (scanFetchProc)READ_ACCESS(fbFetchTransformed); + image->common.get_scanline_64 = (scanFetchProc)READ_ACCESS(fbFetchTransformed64); + image->common.get_scanline_32 = (scanFetchProc)READ_ACCESS(fbFetchTransformed); } } } +scanFetchProc +_pixman_image_get_fetcher (pixman_image_t *image, + int wide) +{ + set_fetchers (image); + if (wide) + return image->common.get_scanline_64; + else + return image->common.get_scanline_32; +} + #define WRITE_ACCESS(f) ((image->common.write_func)? f##_accessors : f) @@ -243,6 +247,8 @@ _pixman_image_get_storer (pixman_image_t *image, static void image_property_changed (pixman_image_t *image) { + + image->common.property_changed (image); } diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index 9a9ec59..0881a7c 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -337,6 +337,8 @@ struct image_common pixman_write_memory_func_t write_func; classify_func_t classify; property_changed_func_t property_changed; + scanFetchProc get_scanline_32; + scanFetchProc get_scanline_64; }; struct source_image