[Pixman] [PATCH 08/15] Allow NULL property_changed function.

Søren Sandmann sandmann at cs.au.dk
Sat Jan 8 03:21:52 PST 2011


From: Søren Sandmann Pedersen <ssp at redhat.com>

Initialize the field to NULL, and then delete the empty functions from
the solid, linear, radial, and conical images.
---
 pixman/pixman-conical-gradient.c |    7 -------
 pixman/pixman-image.c            |    4 +++-
 pixman/pixman-linear-gradient.c  |    6 ------
 pixman/pixman-radial-gradient.c  |    7 -------
 pixman/pixman-solid-fill.c       |    6 ------
 5 files changed, 3 insertions(+), 27 deletions(-)

diff --git a/pixman/pixman-conical-gradient.c b/pixman/pixman-conical-gradient.c
index a00170b..d43b454 100644
--- a/pixman/pixman-conical-gradient.c
+++ b/pixman/pixman-conical-gradient.c
@@ -156,11 +156,6 @@ conical_gradient_get_scanline_32 (pixman_image_t *image,
     }
 }
 
-static void
-conical_gradient_property_changed (pixman_image_t *image)
-{
-}
-
 static uint32_t *
 conical_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask)
 {
@@ -221,8 +216,6 @@ pixman_image_create_conical_gradient (pixman_point_fixed_t *        center,
     conical->center = *center;
     conical->angle = (pixman_fixed_to_double (angle) / 180.0) * M_PI;
 
-    image->common.property_changed = conical_gradient_property_changed;
-
     return image;
 }
 
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index e059286..1aa9de1 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -73,6 +73,7 @@ _pixman_image_allocate (void)
 	common->component_alpha = FALSE;
 	common->ref_count = 1;
 	common->classify = NULL;
+	common->property_changed = NULL;
 	common->client_clip = FALSE;
 	common->destroy_func = NULL;
 	common->destroy_data = NULL;
@@ -416,7 +417,8 @@ _pixman_image_validate (pixman_image_t *image)
 	 * property_changed() can make use of the flags
 	 * to set up accessors etc.
 	 */
-	image->common.property_changed (image);
+	if (image->common.property_changed)
+	    image->common.property_changed (image);
 
 	image->common.dirty = FALSE;
     }
diff --git a/pixman/pixman-linear-gradient.c b/pixman/pixman-linear-gradient.c
index 6640610..a4f18fd 100644
--- a/pixman/pixman-linear-gradient.c
+++ b/pixman/pixman-linear-gradient.c
@@ -219,11 +219,6 @@ linear_gradient_get_scanline_32 (pixman_image_t *image,
     }
 }
 
-static void
-linear_gradient_property_changed (pixman_image_t *image)
-{
-}
-
 static uint32_t *
 linear_gradient_get_scanline_narrow (pixman_iter_t  *iter,
 				     const uint32_t *mask)
@@ -294,7 +289,6 @@ pixman_image_create_linear_gradient (pixman_point_fixed_t *        p1,
 
     image->type = LINEAR;
     image->common.classify = linear_gradient_classify;
-    image->common.property_changed = linear_gradient_property_changed;
 
     return image;
 }
diff --git a/pixman/pixman-radial-gradient.c b/pixman/pixman-radial-gradient.c
index 7d14dd9..6e2d016 100644
--- a/pixman/pixman-radial-gradient.c
+++ b/pixman/pixman-radial-gradient.c
@@ -370,11 +370,6 @@ radial_gradient_get_scanline_32 (pixman_image_t *image,
     }
 }
 
-static void
-radial_gradient_property_changed (pixman_image_t *image)
-{
-}
-
 static uint32_t *
 radial_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask)
 {
@@ -455,8 +450,6 @@ pixman_image_create_radial_gradient (pixman_point_fixed_t *        inner,
 
     radial->mindr = -1. * pixman_fixed_1 * radial->c1.radius;
 
-    image->common.property_changed = radial_gradient_property_changed;
-
     return image;
 }
 
diff --git a/pixman/pixman-solid-fill.c b/pixman/pixman-solid-fill.c
index f2df3c7..2531dbd 100644
--- a/pixman/pixman-solid-fill.c
+++ b/pixman/pixman-solid-fill.c
@@ -69,11 +69,6 @@ solid_fill_classify (pixman_image_t *image,
     return SOURCE_IMAGE_CLASS_HORIZONTAL;
 }
 
-static void
-solid_fill_property_changed (pixman_image_t *image)
-{
-}
-
 void
 _pixman_solid_fill_iter_init (pixman_image_t *image,
 			      pixman_iter_t  *iter,
@@ -128,7 +123,6 @@ pixman_image_create_solid_fill (pixman_color_t *color)
     img->solid.color_64 = color_to_uint64 (color);
 
     img->common.classify = solid_fill_classify;
-    img->common.property_changed = solid_fill_property_changed;
 
     return img;
 }
-- 
1.6.0.6



More information about the Pixman mailing list