From 70658f0a6bd451a21fbb43df7865a7dac95abe24 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Wed, 20 Oct 2010 16:09:44 -0400 Subject: [PATCH] Remove the class field from source_image_t The linear gradient was the only image type that relied on the class being stored in the image struct itself. With the previous changes, it doesn't need that anymore, so we can delete the field. --- pixman/pixman-image.c | 1 - pixman/pixman-linear-gradient.c | 12 ++++++------ pixman/pixman-private.h | 1 - pixman/pixman-solid-fill.c | 3 +-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c index 7a9c423..fabcd63 100644 --- a/pixman/pixman-image.c +++ b/pixman/pixman-image.c @@ -48,7 +48,6 @@ _pixman_init_gradient (gradient_t * gradient, gradient->n_stops = n_stops; gradient->stop_range = 0xffff; - gradient->common.class = SOURCE_IMAGE_CLASS_UNKNOWN; return TRUE; } diff --git a/pixman/pixman-linear-gradient.c b/pixman/pixman-linear-gradient.c index c6ac980..b048e7b 100644 --- a/pixman/pixman-linear-gradient.c +++ b/pixman/pixman-linear-gradient.c @@ -44,8 +44,9 @@ linear_gradient_classify (pixman_image_t *image, pixman_fixed_32_32_t l; pixman_fixed_48_16_t dx, dy; double inc; + source_image_class_t class; - source->class = SOURCE_IMAGE_CLASS_UNKNOWN; + class = SOURCE_IMAGE_CLASS_UNKNOWN; if (source->common.transform) { @@ -54,7 +55,7 @@ linear_gradient_classify (pixman_image_t *image, source->common.transform->matrix[2][1] != 0 || source->common.transform->matrix[2][2] == 0) { - return source->class; + return class; } v.vector[0] = source->common.transform->matrix[0][1]; @@ -74,7 +75,7 @@ linear_gradient_classify (pixman_image_t *image, l = dx * dx + dy * dy; if (l == 0) - return source->class; + return class; /* * compute how much the input of the gradient walked changes @@ -86,9 +87,9 @@ linear_gradient_classify (pixman_image_t *image, /* check that casting to integer would result in 0 */ if (-1 < inc && inc < 1) - source->class = SOURCE_IMAGE_CLASS_HORIZONTAL; + class = SOURCE_IMAGE_CLASS_HORIZONTAL; - return source->class; + return class; } static void @@ -253,7 +254,6 @@ pixman_image_create_linear_gradient (pixman_point_fixed_t * p1, linear->p2 = *p2; image->type = LINEAR; - image->source.class = SOURCE_IMAGE_CLASS_UNKNOWN; image->common.classify = linear_gradient_classify; image->common.property_changed = linear_gradient_property_changed; diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index 77f629a..c43172b 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -111,7 +111,6 @@ struct image_common struct source_image { image_common_t common; - source_image_class_t class; }; struct solid_fill diff --git a/pixman/pixman-solid-fill.c b/pixman/pixman-solid-fill.c index 44f3362..1d911e9 100644 --- a/pixman/pixman-solid-fill.c +++ b/pixman/pixman-solid-fill.c @@ -66,7 +66,7 @@ solid_fill_classify (pixman_image_t *image, int width, int height) { - return (image->source.class = SOURCE_IMAGE_CLASS_HORIZONTAL); + return SOURCE_IMAGE_CLASS_HORIZONTAL; } static void @@ -109,7 +109,6 @@ pixman_image_create_solid_fill (pixman_color_t *color) img->solid.color_32 = color_to_uint32 (color); img->solid.color_64 = color_to_uint64 (color); - img->source.class = SOURCE_IMAGE_CLASS_UNKNOWN; img->common.classify = solid_fill_classify; img->common.property_changed = solid_fill_property_changed; -- 2.7.4