[cairo-commit] 5 commits - src/cairoint.h src/cairo-paginated-surface-private.h src/cairo-scaled-font.c src/cairo-truetype-subset.c

Carl Worth cworth at kemper.freedesktop.org
Wed Apr 11 16:39:21 PDT 2007


 src/cairo-paginated-surface-private.h |    2 
 src/cairo-scaled-font.c               |   53 +++++-----
 src/cairo-truetype-subset.c           |  178 ++++++++++++++++++++++------------
 src/cairoint.h                        |   52 ++++-----
 4 files changed, 178 insertions(+), 107 deletions(-)

New commits:
diff-tree c8645c85de94b83fe2fd60a4d881cb639eb79b46 (from parents)
Merge: be98123b2c30a3102629afff74b9233c18e0535d 52435e99f31f06c18273a5a7351a2c21f7c0ecf6
Author: Carl Worth <cworth at cworth.org>
Date:   Wed Apr 11 16:38:46 2007 -0700

    Merge branch 'master' of git.cairographics.org:/git/cairo into cairo

diff-tree be98123b2c30a3102629afff74b9233c18e0535d (from parents)
Merge: efedf57f43540ad79eddcc5ee79dc0d86846891e a6506c67f24331c703dd56502a1bc4504b7b2311
Author: Carl Worth <cworth at cworth.org>
Date:   Wed Apr 11 16:02:08 2007 -0700

    Merge cached-scaled-font-in-error into cairo
    
    Conflicts:
    
    	src/cairo-scaled-font.c

diff --cc src/cairo-scaled-font.c
index b582539,cda2bde..48d93e4
@@@ -514,35 -503,44 +514,44 @@@
  	    memmove (&font_map->holdovers[i],
  		     &font_map->holdovers[i+1],
  		     (font_map->num_holdovers - i) * sizeof (cairo_scaled_font_t*));
+ 
+ 	    /* reset any error status */
+ 	    scaled_font->status = CAIRO_STATUS_SUCCESS;
  	}
 -	
 +
- 	/* We increment the reference count manually here, (rather
- 	 * than calling into cairo_scaled_font_reference), since we
- 	 * must modify the reference count while our lock is still
- 	 * held. */
- 	scaled_font->ref_count++;
- 	_cairo_scaled_font_map_unlock ();
-     } else {
- 	/* Otherwise create it and insert it into the hash table. */
- 	status = font_face->backend->scaled_font_create (font_face, font_matrix,
- 							 ctm, options, &scaled_font);
- 	if (status) {
+ 	if (scaled_font->status == CAIRO_STATUS_SUCCESS) {
+ 	    /* We increment the reference count manually here, (rather
+ 	     * than calling into cairo_scaled_font_reference), since we
+ 	     * must modify the reference count while our lock is still
+ 	     * held. */
+ 	    scaled_font->ref_count++;
  	    _cairo_scaled_font_map_unlock ();
- 	    return (cairo_scaled_font_t *)&_cairo_scaled_font_nil;
+ 	    return scaled_font;
  	}
  
- 	status = _cairo_hash_table_insert (font_map->hash_table,
- 					   &scaled_font->hash_entry);
+ 	/* the font has been put into an error status - abandon the cache */
+ 	_cairo_hash_table_remove (font_map->hash_table, &key.hash_entry);
+     }
+ 
+     /* Otherwise create it and insert it into the hash table. */
+     status = font_face->backend->scaled_font_create (font_face, font_matrix,
+ 						     ctm, options, &scaled_font);
+     if (status) {
  	_cairo_scaled_font_map_unlock ();
 -	return NULL;
++	return (cairo_scaled_font_t *)&_cairo_scaled_font_nil;
+     }
  
- 	if (status) {
- 	    /* We can't call _cairo_scaled_font_destroy here since it expects
- 	     * that the font has already been successfully inserted into the
- 	     * hash table. */
- 	    _cairo_scaled_font_fini (scaled_font);
- 	    free (scaled_font);
- 	    return (cairo_scaled_font_t *)&_cairo_scaled_font_nil;
- 	}
+     status = _cairo_hash_table_insert (font_map->hash_table,
+ 				       &scaled_font->hash_entry);
+     _cairo_scaled_font_map_unlock ();
+ 
+     if (status) {
+ 	/* We can't call _cairo_scaled_font_destroy here since it expects
+ 	 * that the font has already been successfully inserted into the
+ 	 * hash table. */
+ 	_cairo_scaled_font_fini (scaled_font);
+ 	free (scaled_font);
 -	return NULL;
++	return (cairo_scaled_font_t *)&_cairo_scaled_font_nil;
      }
  
      return scaled_font;
diff-tree a6506c67f24331c703dd56502a1bc4504b7b2311 (from 0f0ed88ee26f22c1b0e0ec7c95b8a258d137dde4)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Apr 8 23:27:52 2007 +0100

    Don't return scaled fonts in the error state from the cache.
    
    It is possible for a scaled_font to be flagged as in error, though only
    through a "true error" e.g. a malloc failure. However, when returning a font
    from the cache it should not be in error. So if we find a error font in the
    cache we remove it and return a new font.

diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index a4754f7..cda2bde 100644
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -503,35 +503,44 @@ cairo_scaled_font_create (cairo_font_fac
 	    memmove (&font_map->holdovers[i],
 		     &font_map->holdovers[i+1],
 		     (font_map->num_holdovers - i) * sizeof (cairo_scaled_font_t*));
-	}
 
-	/* We increment the reference count manually here, (rather
-	 * than calling into cairo_scaled_font_reference), since we
-	 * must modify the reference count while our lock is still
-	 * held. */
-	scaled_font->ref_count++;
-	_cairo_scaled_font_map_unlock ();
-    } else {
-	/* Otherwise create it and insert it into the hash table. */
-	status = font_face->backend->scaled_font_create (font_face, font_matrix,
-							 ctm, options, &scaled_font);
-	if (status) {
+	    /* reset any error status */
+	    scaled_font->status = CAIRO_STATUS_SUCCESS;
+	}
+	
+	if (scaled_font->status == CAIRO_STATUS_SUCCESS) {
+	    /* We increment the reference count manually here, (rather
+	     * than calling into cairo_scaled_font_reference), since we
+	     * must modify the reference count while our lock is still
+	     * held. */
+	    scaled_font->ref_count++;
 	    _cairo_scaled_font_map_unlock ();
-	    return NULL;
+	    return scaled_font;
 	}
 
-	status = _cairo_hash_table_insert (font_map->hash_table,
-					   &scaled_font->hash_entry);
+	/* the font has been put into an error status - abandon the cache */
+	_cairo_hash_table_remove (font_map->hash_table, &key.hash_entry);
+    }
+
+    /* Otherwise create it and insert it into the hash table. */
+    status = font_face->backend->scaled_font_create (font_face, font_matrix,
+						     ctm, options, &scaled_font);
+    if (status) {
 	_cairo_scaled_font_map_unlock ();
+	return NULL;
+    }
 
-	if (status) {
-	    /* We can't call _cairo_scaled_font_destroy here since it expects
-	     * that the font has already been successfully inserted into the
-	     * hash table. */
-	    _cairo_scaled_font_fini (scaled_font);
-	    free (scaled_font);
-	    return NULL;
-	}
+    status = _cairo_hash_table_insert (font_map->hash_table,
+				       &scaled_font->hash_entry);
+    _cairo_scaled_font_map_unlock ();
+
+    if (status) {
+	/* We can't call _cairo_scaled_font_destroy here since it expects
+	 * that the font has already been successfully inserted into the
+	 * hash table. */
+	_cairo_scaled_font_fini (scaled_font);
+	free (scaled_font);
+	return NULL;
     }
 
     return scaled_font;
diff-tree efedf57f43540ad79eddcc5ee79dc0d86846891e (from e6ca34e718859b40dc8eb75a6c68b056751a6deb)
Author: Carl Worth <cworth at cworth.org>
Date:   Wed Apr 11 15:25:18 2007 -0700

    cairo-truetype-subset.c: Add missing error checks and propagation
    
    These are all to satisfy new warnings caused by the preceding commit,
    (which added cairo_warn to various function tables). While fixing the
    propoagation, fix functions to declare a return type of cairo_status_t
    instead of int.

diff --git a/src/cairo-truetype-subset.c b/src/cairo-truetype-subset.c
index e8137a7..8565fea 100644
--- a/src/cairo-truetype-subset.c
+++ b/src/cairo-truetype-subset.c
@@ -82,7 +82,7 @@ static cairo_status_t
 _cairo_truetype_font_create (cairo_scaled_font_subset_t  *scaled_font_subset,
 			     cairo_truetype_font_t      **font_return)
 {
-    cairo_status_t status = CAIRO_STATUS_NO_MEMORY;
+    cairo_status_t status;
     cairo_truetype_font_t *font;
     const cairo_scaled_font_backend_t *backend;
     tt_head_t head;
@@ -129,16 +129,22 @@ _cairo_truetype_font_create (cairo_scale
                                       TT_TAG_name, 0, NULL,
                                       &size) != CAIRO_STATUS_SUCCESS)
 	return CAIRO_INT_STATUS_UNSUPPORTED;
+
     name = malloc(size);
     if (name == NULL)
         return CAIRO_STATUS_NO_MEMORY;
-    backend->load_truetype_table (scaled_font_subset->scaled_font,
-                                 TT_TAG_name, 0, (unsigned char *) name,
-                                 &size);
+
+    status = backend->load_truetype_table (scaled_font_subset->scaled_font,
+					   TT_TAG_name, 0, (unsigned char *) name,
+					   &size);
+    if (status)
+	goto fail0;
 
     font = malloc (sizeof (cairo_truetype_font_t));
-    if (font == NULL)
+    if (font == NULL) {
+	status = CAIRO_STATUS_NO_MEMORY;
 	goto fail0;
+    }
 
     font->backend = backend;
     font->num_glyphs_in_face = be16_to_cpu (maxp.num_glyphs);
@@ -147,15 +153,21 @@ _cairo_truetype_font_create (cairo_scale
     font->last_offset = 0;
     font->last_boundary = 0;
     _cairo_array_init (&font->output, sizeof (char));
-    if (_cairo_array_grow_by (&font->output, 4096) != CAIRO_STATUS_SUCCESS)
+    status = _cairo_array_grow_by (&font->output, 4096);
+    if (status)
 	goto fail1;
+
     font->glyphs = calloc (font->num_glyphs_in_face + 1, sizeof (subset_glyph_t));
-    if (font->glyphs == NULL)
+    if (font->glyphs == NULL) {
+	status = CAIRO_STATUS_NO_MEMORY;
 	goto fail2;
+    }
 
     font->parent_to_subset = calloc (font->num_glyphs_in_face, sizeof (int));
-    if (font->parent_to_subset == NULL)
+    if (font->parent_to_subset == NULL) {
+	status = CAIRO_STATUS_NO_MEMORY;
 	goto fail3;
+    }
 
     font->base.num_glyphs = 0;
     font->base.x_min = (int16_t) be16_to_cpu (head.x_min);
@@ -196,8 +208,11 @@ _cairo_truetype_font_create (cairo_scale
 
     if (font->base.base_font == NULL) {
         font->base.base_font = malloc (30);
-        if (font->base.base_font == NULL)
+        if (font->base.base_font == NULL) {
+	    status = CAIRO_STATUS_NO_MEMORY;
             goto fail4; 
+	}
+
         snprintf(font->base.base_font, 30, "CairoFont-%u-%u",
                  scaled_font_subset->font_id,
                  scaled_font_subset->subset_id);
@@ -211,11 +226,14 @@ _cairo_truetype_font_create (cairo_scale
     font->base.base_font[i] = '\0';
 
     font->base.widths = calloc (font->num_glyphs_in_face, sizeof (int));
-    if (font->base.widths == NULL)
+    if (font->base.widths == NULL) {
+	status = CAIRO_STATUS_NO_MEMORY;
 	goto fail5;
+    }
 
     _cairo_array_init (&font->string_offsets, sizeof (unsigned long));
-    if (_cairo_array_grow_by (&font->string_offsets, 10) != CAIRO_STATUS_SUCCESS)
+    status = _cairo_array_grow_by (&font->string_offsets, 10);
+    if (status)
 	goto fail6;
 
     font->status = CAIRO_STATUS_SUCCESS;
@@ -239,6 +257,7 @@ _cairo_truetype_font_create (cairo_scale
  fail0:
     if (name)
 	free (name);
+
     return status;
 }
 
@@ -340,7 +359,7 @@ cairo_truetype_font_check_boundary (cair
     return CAIRO_STATUS_SUCCESS;
 }
 
-static int
+static cairo_status_t
 cairo_truetype_font_write_cmap_table (cairo_truetype_font_t *font,
 				      unsigned long          tag)
 {
@@ -389,7 +408,7 @@ cairo_truetype_font_write_cmap_table (ca
     return font->status;
 }
 
-static int
+static cairo_status_t
 cairo_truetype_font_write_generic_table (cairo_truetype_font_t *font,
 					 unsigned long          tag)
 {
@@ -403,11 +422,17 @@ cairo_truetype_font_write_generic_table 
         font->status = CAIRO_INT_STATUS_UNSUPPORTED;
         return font->status;
     }
+
     status = cairo_truetype_font_allocate_write_buffer (font, size, &buffer);
-    /* XXX: Need to check status here. */
-    font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
-                                        tag, 0, buffer, &size);
-    return 0;
+    if (status)
+	return status;
+
+    status = font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
+						 tag, 0, buffer, &size);
+    if (status)
+	return status;
+
+    return CAIRO_STATUS_SUCCESS;
 }
 
 static void
@@ -444,11 +469,10 @@ cairo_truetype_font_remap_composite_glyp
     } while (has_more_components);
 }
 
-static int
+static cairo_status_t
 cairo_truetype_font_write_glyf_table (cairo_truetype_font_t *font,
 				      unsigned long          tag)
 {
-    cairo_status_t status;
     unsigned long start_offset, index, size, next;
     tt_head_t header;
     unsigned long begin, end;
@@ -461,8 +485,11 @@ cairo_truetype_font_write_glyf_table (ca
     } u;
 
     size = sizeof (tt_head_t);
-    font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
-                                        TT_TAG_head, 0, (unsigned char*) &header, &size);
+    font->status = font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
+						       TT_TAG_head, 0,
+						       (unsigned char*) &header, &size);
+    if (font->status)
+	return font->status;
     
     if (be16_to_cpu (header.index_to_loc_format) == 0)
 	size = sizeof (int16_t) * (font->num_glyphs_in_face + 1);
@@ -474,6 +501,7 @@ cairo_truetype_font_write_glyf_table (ca
 	font->status = CAIRO_STATUS_NO_MEMORY;
 	return font->status;
     }
+
     if (font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
                                             TT_TAG_loca, 0, u.bytes, &size) != CAIRO_STATUS_SUCCESS) {
         font->status = CAIRO_INT_STATUS_UNSUPPORTED;
@@ -496,23 +524,22 @@ cairo_truetype_font_write_glyf_table (ca
 
         next = cairo_truetype_font_align_output (font);
 
-        status = cairo_truetype_font_check_boundary (font, next);
-	if (status) {
-	    font->status = status;
+        font->status = cairo_truetype_font_check_boundary (font, next);
+	if (font->status)
 	    break;
-	}
 
         font->glyphs[i].location = next - start_offset;
 
-	status = cairo_truetype_font_allocate_write_buffer (font, size, &buffer);
-	if (status) {
-	    font->status = status;
+	font->status = cairo_truetype_font_allocate_write_buffer (font, size, &buffer);
+	if (font->status)
 	    break;
-	}
 
         if (size != 0) {
-            font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
-                                                TT_TAG_glyf, begin, buffer, &size);
+            font->status = font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
+							       TT_TAG_glyf, begin, buffer, &size);
+	    if (font->status)
+		break;
+
             cairo_truetype_font_remap_composite_glyph (font, buffer);
         }
     }
@@ -525,7 +552,7 @@ cairo_truetype_font_write_glyf_table (ca
     return font->status;
 }
 
-static int
+static cairo_status_t
 cairo_truetype_font_write_head_table (cairo_truetype_font_t *font,
                                       unsigned long          tag)
 {
@@ -533,36 +560,52 @@ cairo_truetype_font_write_head_table (ca
     unsigned long size;
 
     size = 0;
-    font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
-                                        tag, 0, NULL, &size);
+    font->status = font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
+						       tag, 0, NULL, &size);
+    if (font->status)
+	return font->status;
+
     font->checksum_index = _cairo_array_num_elements (&font->output) + 8;
     font->status = cairo_truetype_font_allocate_write_buffer (font, size, &buffer);
-    font->backend->load_truetype_table( font->scaled_font_subset->scaled_font,
-                                        tag, 0, buffer, &size);
+    if (font->status)
+	return font->status;
+
+    font->status = font->backend->load_truetype_table( font->scaled_font_subset->scaled_font,
+						       tag, 0, buffer, &size);
+    if (font->status)
+	return font->status;
+
     /* set checkSumAdjustment to 0 for table checksum calcualtion */
     *(uint32_t *)(buffer + 8) = 0;
 
     return font->status;
 }
 
-static int cairo_truetype_font_write_hhea_table (cairo_truetype_font_t *font, unsigned long tag)
+static cairo_status_t
+cairo_truetype_font_write_hhea_table (cairo_truetype_font_t *font, unsigned long tag)
 {
     tt_hhea_t *hhea;
     unsigned long size;
 
     size = sizeof (tt_hhea_t);
     font->status = cairo_truetype_font_allocate_write_buffer (font, size, (unsigned char **) &hhea);
-    font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
-                                        tag, 0, (unsigned char *) hhea, &size);
+    if (font->status)
+	return font->status;
+
+    font->status = font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
+						       tag, 0, (unsigned char *) hhea, &size);
+    if (font->status)
+	return font->status;
+
     hhea->num_hmetrics = cpu_to_be16 ((uint16_t)(font->base.num_glyphs));
+
     return font->status;
 }
 
-static int
+static cairo_status_t
 cairo_truetype_font_write_hmtx_table (cairo_truetype_font_t *font,
 				      unsigned long          tag)
 {
-    cairo_status_t status;
     unsigned long size;
     unsigned long long_entry_size;
     unsigned long short_entry_size;
@@ -572,15 +615,22 @@ cairo_truetype_font_write_hmtx_table (ca
     int num_hmetrics;
 
     size = sizeof (tt_hhea_t);
-    font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
-                                        TT_TAG_hhea, 0, (unsigned char*) &hhea, &size);
+    font->status = font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
+						       TT_TAG_hhea, 0,
+						       (unsigned char*) &hhea, &size);
+    if (font->status)
+	return font->status;
+
     num_hmetrics = be16_to_cpu(hhea.num_hmetrics);
 
     for (i = 0; i < font->base.num_glyphs; i++) {
         long_entry_size = 2 * sizeof (int16_t);
         short_entry_size = sizeof (int16_t);
-        status = cairo_truetype_font_allocate_write_buffer (font, long_entry_size,
-							  (unsigned char **) &p);
+        font->status = cairo_truetype_font_allocate_write_buffer (font, long_entry_size,
+								  (unsigned char **) &p);
+	if (font->status)
+	    return font->status;
+
         if (font->glyphs[i].parent_index < num_hmetrics) {
             if (font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
                                                     TT_TAG_hmtx,
@@ -599,11 +649,13 @@ cairo_truetype_font_write_hmtx_table (ca
                 font->status = CAIRO_INT_STATUS_UNSUPPORTED;
                 return font->status;
             }
-            font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
-                                                TT_TAG_hmtx,
-                                                num_hmetrics * long_entry_size +
-                                                (font->glyphs[i].parent_index - num_hmetrics) * short_entry_size,
-                                                (unsigned char *) (p + 1), &short_entry_size);
+            font->status = font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
+							       TT_TAG_hmtx,
+							       num_hmetrics * long_entry_size +
+							       (font->glyphs[i].parent_index - num_hmetrics) * short_entry_size,
+							       (unsigned char *) (p + 1), &short_entry_size);
+	    if (font->status)
+		return font->status;
         }
         font->base.widths[i] = be16_to_cpu (p[0]);
     }
@@ -611,7 +663,7 @@ cairo_truetype_font_write_hmtx_table (ca
     return font->status;
 }
 
-static int
+static cairo_status_t
 cairo_truetype_font_write_loca_table (cairo_truetype_font_t *font,
 				      unsigned long          tag)
 {
@@ -620,8 +672,11 @@ cairo_truetype_font_write_loca_table (ca
     unsigned long size;
 
     size = sizeof(tt_head_t);
-    font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
-                                        TT_TAG_head, 0, (unsigned char*) &header, &size);
+    font->status = font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
+						       TT_TAG_head, 0,
+						       (unsigned char*) &header, &size);
+    if (font->status)
+	return font->status;
 
     if (be16_to_cpu (header.index_to_loc_format) == 0)
     {
@@ -635,7 +690,7 @@ cairo_truetype_font_write_loca_table (ca
     return font->status;
 }
 
-static int
+static cairo_status_t
 cairo_truetype_font_write_maxp_table (cairo_truetype_font_t *font,
 				      unsigned long          tag)
 {
@@ -644,13 +699,20 @@ cairo_truetype_font_write_maxp_table (ca
 
     size = sizeof (tt_maxp_t);
     font->status = cairo_truetype_font_allocate_write_buffer (font, size, (unsigned char **) &maxp);
-    font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
-                                        tag, 0, (unsigned char *) maxp, &size);
+    if (font->status)
+	return font->status;
+
+    font->status = font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
+						       tag, 0, (unsigned char *) maxp, &size);
+    if (font->status)
+	return font->status;
+
     maxp->num_glyphs = cpu_to_be16 (font->base.num_glyphs);
+
     return font->status;
 }
 
-static int
+static cairo_status_t
 cairo_truetype_font_write_post_table (cairo_truetype_font_t *font,
 				      unsigned long          tag)
 {
@@ -684,7 +746,7 @@ cairo_truetype_font_write_post_table (ca
 typedef struct table table_t;
 struct table {
     unsigned long tag;
-    int (*write) (cairo_truetype_font_t *font, unsigned long tag);
+    cairo_status_t (*write) (cairo_truetype_font_t *font, unsigned long tag);
     int pos; /* position in the font directory */
 };
 
diff-tree e6ca34e718859b40dc8eb75a6c68b056751a6deb (from 3bc413343a0b846c9501ee870db0424412aea701)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Apr 8 22:59:10 2007 +0100

    Mark function tables with attribute(warn_unused_result)

diff --git a/src/cairo-paginated-surface-private.h b/src/cairo-paginated-surface-private.h
index b5e4d5c..1e07f59 100644
--- a/src/cairo-paginated-surface-private.h
+++ b/src/cairo-paginated-surface-private.h
@@ -53,7 +53,7 @@ typedef struct _cairo_paginated_surface_
      * any drawing operations for the page, (that is, it will occur
      * during the user's call to cairo_show_page or cairo_copy_page).
      */
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*start_page)		(void			*surface);
 
     /* Required. Will be called twice for each page, once with an
diff --git a/src/cairoint.h b/src/cairoint.h
index f0ac938..f5ecff0 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -637,7 +637,7 @@ typedef struct _cairo_scaled_font_subset
 struct _cairo_scaled_font_backend {
     cairo_font_type_t type;
 
-    cairo_status_t
+    cairo_warn cairo_status_t
     (*create_toy)  (cairo_toy_font_face_t	*toy_face,
 		    const cairo_matrix_t	*font_matrix,
 		    const cairo_matrix_t	*ctm,
@@ -647,7 +647,7 @@ struct _cairo_scaled_font_backend {
     void
     (*fini)		(void			*scaled_font);
 
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*scaled_glyph_init)	(void			     *scaled_font,
 				 cairo_scaled_glyph_t	     *scaled_glyph,
 				 cairo_scaled_glyph_info_t    info);
@@ -656,7 +656,7 @@ struct _cairo_scaled_font_backend {
      * both. This allows the backend to do something more sophisticated
      * then just converting characters one by one.
      */
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*text_to_glyphs) (void                *scaled_font,
 		       double		    x,
 		       double		    y,
@@ -667,7 +667,7 @@ struct _cairo_scaled_font_backend {
     unsigned long
     (*ucs4_to_index)		(void			     *scaled_font,
 				 uint32_t		      ucs4);
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*show_glyphs)	(void			*scaled_font,
 			 cairo_operator_t	 op,
 			 cairo_pattern_t	*pattern,
@@ -681,7 +681,7 @@ struct _cairo_scaled_font_backend {
 			 cairo_glyph_t		*glyphs,
 			 int			 num_glyphs);
 
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*load_truetype_table)(void		        *scaled_font,
                            unsigned long         tag,
                            long                  offset,
@@ -703,7 +703,7 @@ struct _cairo_font_face_backend {
     void
     (*destroy)     (void			*font_face);
 
-    cairo_status_t
+    cairo_warn cairo_status_t
     (*scaled_font_create) (void				*font_face,
 			   const cairo_matrix_t		*font_matrix,
 			   const cairo_matrix_t		*ctm,
@@ -749,10 +749,10 @@ struct _cairo_surface_backend {
 				 int			 width,
 				 int			 height);
 
-    cairo_status_t
+    cairo_warn cairo_status_t
     (*finish)			(void			*surface);
 
-    cairo_status_t
+    cairo_warn cairo_status_t
     (*acquire_source_image)	(void                    *abstract_surface,
 				 cairo_image_surface_t  **image_out,
 				 void                   **image_extra);
@@ -762,7 +762,7 @@ struct _cairo_surface_backend {
 				 cairo_image_surface_t  *image,
 				 void                   *image_extra);
 
-    cairo_status_t
+    cairo_warn cairo_status_t
     (*acquire_dest_image)       (void                    *abstract_surface,
 				 cairo_rectangle_int16_t *interest_rect,
 				 cairo_image_surface_t  **image_out,
@@ -786,7 +786,7 @@ struct _cairo_surface_backend {
      *
      * 3. It has the same contents as @src within the given rectangle.
      */
-    cairo_status_t
+    cairo_warn cairo_status_t
     (*clone_similar)            (void                   *surface,
 				 cairo_surface_t        *src,
 				 int                     src_x,
@@ -796,7 +796,7 @@ struct _cairo_surface_backend {
 				 cairo_surface_t       **clone_out);
 
     /* XXX: dst should be the first argument for consistency */
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*composite)		(cairo_operator_t	 op,
 				 cairo_pattern_t       	*src,
 				 cairo_pattern_t	*mask,
@@ -810,7 +810,7 @@ struct _cairo_surface_backend {
 				 unsigned int		 width,
 				 unsigned int		 height);
 
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*fill_rectangles)		(void			 *surface,
 				 cairo_operator_t	  op,
 				 const cairo_color_t     *color,
@@ -818,7 +818,7 @@ struct _cairo_surface_backend {
 				 int			  num_rects);
 
     /* XXX: dst should be the first argument for consistency */
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*composite_trapezoids)	(cairo_operator_t	 op,
 				 cairo_pattern_t	*pattern,
 				 void			*dst,
@@ -832,10 +832,10 @@ struct _cairo_surface_backend {
 				 cairo_trapezoid_t	*traps,
 				 int			 num_traps);
 
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*copy_page)		(void			*surface);
 
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*show_page)		(void			*surface);
 
     /* Set given region as the clip region for the surface, replacing
@@ -851,7 +851,7 @@ struct _cairo_surface_backend {
      * this is not possible, cairo will use mask surfaces for
      * clipping.
      */
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*set_clip_region)		(void			*surface,
 				 pixman_region16_t	*region);
 
@@ -869,7 +869,7 @@ struct _cairo_surface_backend {
      * function is not implemented cairo will use set_clip_region()
      * (if available) and mask surfaces for clipping.
      */
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*intersect_clip_path)	(void			*dst,
 				 cairo_path_fixed_t	*path,
 				 cairo_fill_rule_t	fill_rule,
@@ -886,7 +886,7 @@ struct _cairo_surface_backend {
      * into the specific surface->get_extents if there is no current
      * clip.
      */
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*get_extents)		(void			 *surface,
 				 cairo_rectangle_int16_t *rectangle);
 
@@ -895,7 +895,7 @@ struct _cairo_surface_backend {
      * resources. If null, render against this surface, using image
      * surfaces as glyphs.
      */
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*old_show_glyphs)		(cairo_scaled_font_t	        *font,
 				 cairo_operator_t		 op,
 				 cairo_pattern_t		*pattern,
@@ -913,10 +913,10 @@ struct _cairo_surface_backend {
     (*get_font_options)         (void                  *surface,
 				 cairo_font_options_t  *options);
 
-    cairo_status_t
+    cairo_warn cairo_status_t
     (*flush)                    (void                  *surface);
 
-    cairo_status_t
+    cairo_warn cairo_status_t
     (*mark_dirty_rectangle)     (void                  *surface,
 				 int                    x,
 				 int                    y,
@@ -933,18 +933,18 @@ struct _cairo_surface_backend {
     /* OK, I'm starting over somewhat by defining the 5 top-level
      * drawing operators for the surface backend here with consistent
      * naming and argument-order conventions. */
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*paint)			(void			*surface,
 				 cairo_operator_t	 op,
 				 cairo_pattern_t	*source);
 
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*mask)			(void			*surface,
 				 cairo_operator_t	 op,
 				 cairo_pattern_t	*source,
 				 cairo_pattern_t	*mask);
 
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*stroke)			(void			*surface,
 				 cairo_operator_t	 op,
 				 cairo_pattern_t	*source,
@@ -955,7 +955,7 @@ struct _cairo_surface_backend {
 				 double			 tolerance,
 				 cairo_antialias_t	 antialias);
 
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*fill)			(void			*surface,
 				 cairo_operator_t	 op,
 				 cairo_pattern_t	*source,
@@ -964,7 +964,7 @@ struct _cairo_surface_backend {
 				 double			 tolerance,
 				 cairo_antialias_t	 antialias);
 
-    cairo_int_status_t
+    cairo_warn cairo_int_status_t
     (*show_glyphs)		(void			*surface,
 				 cairo_operator_t	 op,
 				 cairo_pattern_t	*source,


More information about the cairo-commit mailing list