From: Søren Sandmann Pedersen Date: Fri, 10 Dec 2010 19:59:20 +0000 (-0500) Subject: Consolidate the various get_scanline_32() into get_scanline_narrow() X-Git-Tag: pixman-0.21.4~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf14189c6993e42ae71977a4a4061417941ffee8;p=platform%2Fupstream%2Fpixman.git Consolidate the various get_scanline_32() into get_scanline_narrow() The separate get_scanline_32() functions in solid, linear, radial and conical images are no longer necessary because all access to these images now go through iterators. --- diff --git a/pixman/pixman-conical-gradient.c b/pixman/pixman-conical-gradient.c index d43b454..9d7d2e8 100644 --- a/pixman/pixman-conical-gradient.c +++ b/pixman/pixman-conical-gradient.c @@ -50,14 +50,15 @@ coordinates_to_parameter (double x, double y, double angle) */ } -static void -conical_gradient_get_scanline_32 (pixman_image_t *image, - int x, - int y, - int width, - uint32_t * buffer, - const uint32_t *mask) +static uint32_t * +conical_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask) { + pixman_image_t *image = iter->image; + int x = iter->x; + int y = iter->y; + int width = iter->width; + uint32_t *buffer = iter->buffer; + gradient_t *gradient = (gradient_t *)image; conical_gradient_t *conical = (conical_gradient_t *)image; uint32_t *end = buffer + width; @@ -82,7 +83,7 @@ conical_gradient_get_scanline_32 (pixman_image_t *image, v.vector[2] = pixman_fixed_1; if (!pixman_transform_point_3d (image->common.transform, &v)) - return; + return iter->buffer; cx = image->common.transform->matrix[0][0] / 65536.; cy = image->common.transform->matrix[1][0] / 65536.; @@ -154,14 +155,6 @@ conical_gradient_get_scanline_32 (pixman_image_t *image, rz += cz; } } -} - -static uint32_t * -conical_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask) -{ - conical_gradient_get_scanline_32 (iter->image, iter->x, iter->y, - iter->width, iter->buffer, - mask); iter->y++; return iter->buffer; diff --git a/pixman/pixman-linear-gradient.c b/pixman/pixman-linear-gradient.c index 4c0792c..c657243 100644 --- a/pixman/pixman-linear-gradient.c +++ b/pixman/pixman-linear-gradient.c @@ -91,14 +91,16 @@ linear_gradient_classify (pixman_image_t *image, return class; } -static void -linear_get_scanline_32 (pixman_image_t *image, - int x, - int y, - int width, - uint32_t * buffer, - const uint32_t *mask) +static uint32_t * +linear_get_scanline_narrow (pixman_iter_t *iter, + const uint32_t *mask) { + pixman_image_t *image = iter->image; + int x = iter->x; + int y = iter->y; + int width = iter->width; + uint32_t * buffer = iter->buffer; + pixman_vector_t v, unit; pixman_fixed_32_32_t l; pixman_fixed_48_16_t dx, dy; @@ -117,7 +119,7 @@ linear_get_scanline_32 (pixman_image_t *image, if (image->common.transform) { if (!pixman_transform_point_3d (image->common.transform, &v)) - return; + return iter->buffer; unit.vector[0] = image->common.transform->matrix[0][0]; unit.vector[1] = image->common.transform->matrix[1][0]; @@ -217,19 +219,6 @@ linear_get_scanline_32 (pixman_image_t *image, v.vector[2] += unit.vector[2]; } } -} - -static uint32_t * -linear_get_scanline_narrow (pixman_iter_t *iter, - const uint32_t *mask) -{ - pixman_image_t *image = iter->image; - int x = iter->x; - int y = iter->y; - int width = iter->width; - uint32_t * buffer = iter->buffer; - - linear_get_scanline_32 (image, x, y, width, buffer, mask); iter->y++; diff --git a/pixman/pixman-radial-gradient.c b/pixman/pixman-radial-gradient.c index d1017d2..6523b82 100644 --- a/pixman/pixman-radial-gradient.c +++ b/pixman/pixman-radial-gradient.c @@ -144,13 +144,8 @@ radial_compute_color (double a, return 0; } -static void -radial_gradient_get_scanline_32 (pixman_image_t *image, - int x, - int y, - int width, - uint32_t * buffer, - const uint32_t *mask) +static uint32_t * +radial_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask) { /* * Implementation of radial gradients following the PDF specification. @@ -233,6 +228,11 @@ radial_gradient_get_scanline_32 (pixman_image_t *image, * <=> for every p, the radiuses associated with the two t solutions * have opposite sign */ + pixman_image_t *image = iter->image; + int x = iter->x; + int y = iter->y; + int width = iter->width; + uint32_t *buffer = iter->buffer; gradient_t *gradient = (gradient_t *)image; radial_gradient_t *radial = (radial_gradient_t *)image; @@ -250,7 +250,7 @@ radial_gradient_get_scanline_32 (pixman_image_t *image, if (image->common.transform) { if (!pixman_transform_point_3d (image->common.transform, &v)) - return; + return iter->buffer; unit.vector[0] = image->common.transform->matrix[0][0]; unit.vector[1] = image->common.transform->matrix[1][0]; @@ -384,14 +384,6 @@ radial_gradient_get_scanline_32 (pixman_image_t *image, v.vector[2] += unit.vector[2]; } } -} - -static uint32_t * -radial_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask) -{ - radial_gradient_get_scanline_32 ( - iter->image, iter->x, iter->y, iter->width, - iter->buffer, mask); iter->y++; return iter->buffer; diff --git a/pixman/pixman-solid-fill.c b/pixman/pixman-solid-fill.c index 2531dbd..a431d74 100644 --- a/pixman/pixman-solid-fill.c +++ b/pixman/pixman-solid-fill.c @@ -26,39 +26,6 @@ #endif #include "pixman-private.h" -static void -solid_fill_get_scanline_32 (pixman_image_t *image, - int x, - int y, - int width, - uint32_t * buffer, - const uint32_t *mask) -{ - uint32_t *end = buffer + width; - uint32_t color = image->solid.color_32; - - while (buffer < end) - *(buffer++) = color; - - return; -} - -static void -solid_fill_get_scanline_64 (pixman_image_t *image, - int x, - int y, - int width, - uint32_t * buffer, - const uint32_t *mask) -{ - uint64_t *b = (uint64_t *)buffer; - uint64_t *e = b + width; - uint64_t color = image->solid.color_64; - - while (b < e) - *(b++) = color; -} - static source_image_class_t solid_fill_classify (pixman_image_t *image, int x, @@ -77,13 +44,21 @@ _pixman_solid_fill_iter_init (pixman_image_t *image, { if (flags & ITER_NARROW) { - solid_fill_get_scanline_32 ( - image, x, y, width, (uint32_t *)buffer, NULL); + uint32_t *b = (uint32_t *)buffer; + uint32_t *e = b + width; + uint32_t color = image->solid.color_32; + + while (b < e) + *(b++) = color; } else { - solid_fill_get_scanline_64 ( - image, x, y, width, (uint32_t *)buffer, NULL); + uint64_t *b = (uint64_t *)buffer; + uint64_t *e = b + width; + uint64_t color = image->solid.color_64; + + while (b < e) + *(b++) = color; } iter->get_scanline = _pixman_iter_get_scanline_noop;