[cairo-commit] src/cairoint.h src/cairo-pattern.c

Andrea Canciani ranma42 at kemper.freedesktop.org
Mon Jan 3 11:18:21 PST 2011


 src/cairo-pattern.c |   39 ---------------------------------------
 src/cairoint.h      |    3 ---
 2 files changed, 42 deletions(-)

New commits:
commit f0bb3a29b36f85973ba678b19c5bf057f18506ed
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Mon Jan 3 20:12:07 2011 +0100

    pattern: Remove unused _cairo_pattern_size function
    
    'git log -S_cairo_pattern_size' only finds the commit
    a856371bef496da0e84226f4fd2fc3cb72e955ac, in which this function was
    added, thus it looks like it has never been used.

diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 08e0708..fa38f19 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -4470,45 +4470,6 @@ _cairo_pattern_hash (const cairo_pattern_t *pattern)
     }
 }
 
-static unsigned long
-_cairo_gradient_pattern_color_stops_size (const cairo_pattern_t *pattern)
-{
-    cairo_gradient_pattern_t *gradient = (cairo_gradient_pattern_t *) pattern;
-
-    return gradient->n_stops * (sizeof (double) + sizeof (cairo_color_t));
-}
-
-unsigned long
-_cairo_pattern_size (const cairo_pattern_t *pattern)
-{
-    if (pattern->status)
-	return 0;
-
-    /* XXX */
-    switch (pattern->type) {
-    case CAIRO_PATTERN_TYPE_SOLID:
-	return sizeof (cairo_solid_pattern_t);
-	break;
-    case CAIRO_PATTERN_TYPE_SURFACE:
-	return sizeof (cairo_surface_pattern_t);
-	break;
-    case CAIRO_PATTERN_TYPE_LINEAR:
-	return sizeof (cairo_linear_pattern_t) +
-	    _cairo_gradient_pattern_color_stops_size (pattern);
-	break;
-    case CAIRO_PATTERN_TYPE_RADIAL:
-	return sizeof (cairo_radial_pattern_t) +
-	    _cairo_gradient_pattern_color_stops_size (pattern);
-    case CAIRO_PATTERN_TYPE_MESH:
-	return sizeof (cairo_mesh_pattern_t) +
-	    _cairo_gradient_pattern_color_stops_size (pattern);
-    default:
-	ASSERT_NOT_REACHED;
-	return 0;
-    }
-}
-
-
 static cairo_bool_t
 _cairo_solid_pattern_equal (const cairo_solid_pattern_t *a,
 			    const cairo_solid_pattern_t *b)
diff --git a/src/cairoint.h b/src/cairoint.h
index f8e13b2..f203ec5 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -2316,9 +2316,6 @@ cairo_private cairo_bool_t
 _cairo_linear_pattern_equal (const cairo_linear_pattern_t *a,
 			     const cairo_linear_pattern_t *b);
 
-cairo_private unsigned long
-_cairo_pattern_size (const cairo_pattern_t *pattern);
-
 cairo_private cairo_bool_t
 _cairo_radial_pattern_equal (const cairo_radial_pattern_t *a,
 			     const cairo_radial_pattern_t *b);


More information about the cairo-commit mailing list