Allow NULL property_changed function
authorSøren Sandmann Pedersen <ssp@redhat.com>
Fri, 10 Dec 2010 19:44:22 +0000 (14:44 -0500)
committerSøren Sandmann Pedersen <ssp@redhat.com>
Tue, 18 Jan 2011 17:42:26 +0000 (12:42 -0500)
Initialize the field to NULL, and then delete the empty functions from
the solid, linear, radial, and conical images.

pixman/pixman-conical-gradient.c
pixman/pixman-image.c
pixman/pixman-linear-gradient.c
pixman/pixman-radial-gradient.c
pixman/pixman-solid-fill.c

index a00170b..d43b454 100644 (file)
@@ -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;
 }
 
index e059286..1aa9de1 100644 (file)
@@ -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;
     }
index a19d9a8..4c0792c 100644 (file)
@@ -219,11 +219,6 @@ linear_get_scanline_32 (pixman_image_t *image,
     }
 }
 
-static void
-linear_gradient_property_changed (pixman_image_t *image)
-{
-}
-
 static uint32_t *
 linear_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;
 }
index 5121827..d1017d2 100644 (file)
@@ -386,11 +386,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)
 {
@@ -471,8 +466,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;
 }
 
index f2df3c7..2531dbd 100644 (file)
@@ -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;
 }