From 51d972ecd885b05165a09d19fb3491ecb3ce813a Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Sat, 2 May 2009 22:55:56 -0400 Subject: [PATCH] Replace pixman_image_get_fetchers() with pixman_image_get_scanline_{32,64} --- pixman/pixman-compose.c | 12 +++++++++--- pixman/pixman-image.c | 20 ++++++++++++++++++-- pixman/pixman-private.h | 13 ++++++++++--- 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/pixman/pixman-compose.c b/pixman/pixman-compose.c index be922a7..d13d87c 100644 --- a/pixman/pixman-compose.c +++ b/pixman/pixman-compose.c @@ -63,18 +63,24 @@ pixman_composite_rect_general_internal (const FbComposeData *data, if (data->op == PIXMAN_OP_CLEAR) fetchSrc = NULL; + else if (wide) + fetchSrc = _pixman_image_get_scanline_64; else - fetchSrc = _pixman_image_get_fetcher (data->src, wide); + fetchSrc = _pixman_image_get_scanline_32; if (!data->mask || data->op == PIXMAN_OP_CLEAR) fetchMask = NULL; + else if (wide) + fetchMask = _pixman_image_get_scanline_64; else - fetchMask = _pixman_image_get_fetcher (data->mask, wide); + fetchMask = _pixman_image_get_scanline_32; if (data->op == PIXMAN_OP_CLEAR || data->op == PIXMAN_OP_SRC) fetchDest = NULL; + else if (wide) + fetchDest = _pixman_image_get_scanline_64; else - fetchDest = _pixman_image_get_fetcher (data->dest, wide); + fetchDest = _pixman_image_get_scanline_32; store = _pixman_image_get_storer (data->dest, wide); diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c index dd21718..0553a5a 100644 --- a/pixman/pixman-image.c +++ b/pixman/pixman-image.c @@ -98,6 +98,24 @@ _pixman_image_classify (pixman_image_t *image, return SOURCE_IMAGE_CLASS_UNKNOWN; } +void +_pixman_image_get_scanline_32 (pixman_image_t *image, int x, int y, int width, + uint32_t *buffer, uint32_t *mask, uint32_t mask_bits) +{ + image->common.get_scanline_32 (image, x, y, width, buffer, mask, mask_bits); +} + +void +_pixman_image_get_scanline_64 (pixman_image_t *image, int x, int y, int width, + uint32_t *buffer, uint32_t *unused, uint32_t unused2) +{ + image->common.get_scanline_64 (image, x, y, width, buffer, unused, unused2); +} + +/* Even thought the type of buffer is uint32_t *, the function actually expects + * a uint64_t *buffer. + */ + scanFetchProc _pixman_image_get_fetcher (pixman_image_t *image, int wide) @@ -111,8 +129,6 @@ _pixman_image_get_fetcher (pixman_image_t *image, return image->common.get_scanline_32; } - - #define WRITE_ACCESS(f) ((image->common.write_func)? f##_accessors : f) static void diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index 0881a7c..9baab65 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -287,9 +287,16 @@ source_pict_class_t _pixman_image_classify (pixman_image_t *image, int width, int height); -scanFetchProc -_pixman_image_get_fetcher (pixman_image_t *image, - int wide); +void +_pixman_image_get_scanline_32 (pixman_image_t *image, int x, int y, int width, + uint32_t *buffer, uint32_t *mask, uint32_t mask_bits); + +/* Even thought the type of buffer is uint32_t *, the function actually expects + * a uint64_t *buffer. + */ +void +_pixman_image_get_scanline_64 (pixman_image_t *image, int x, int y, int width, + uint32_t *buffer, uint32_t *unused, uint32_t unused2); scanStoreProc _pixman_image_get_storer (pixman_image_t *image, -- 2.7.4