[cairo-commit] src/cairo-scaled-font.c src/cairo-surface.c

Behdad Esfahbod behdad at kemper.freedesktop.org
Sat Dec 23 14:08:09 PST 2006


 src/cairo-scaled-font.c |    3 +++
 src/cairo-surface.c     |    3 +++
 2 files changed, 6 insertions(+)

New commits:
diff-tree 8fd7328ebb77b0a641cf30bded85e482ea63ad97 (from 3212fc4f0fcc66ec3a93994f253c1477eb434572)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Dec 23 17:08:04 2006 -0500

    Don't call into backends if num_glyphs is zero (#5177)
    
    Just return success in _cairo_scaled_font_show_glyphs() and
    _cairo_surface_show_glyphs() if num_glyphs is zero.

diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index e07ab53..73afb5f 100755
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -920,6 +920,9 @@ _cairo_scaled_font_show_glyphs (cairo_sc
     if (scaled_font->status)
 	return scaled_font->status;
 
+    if (!num_glyphs)
+	return CAIRO_STATUS_SUCCESS;
+
     if (scaled_font->backend->show_glyphs != NULL) {
 	status = scaled_font->backend->show_glyphs (scaled_font,
 						    op, pattern,
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 6690971..ee9a289 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -1812,6 +1812,9 @@ _cairo_surface_show_glyphs (cairo_surfac
         return CAIRO_STATUS_NO_MEMORY;
     }
 
+    if (!num_glyphs)
+	return CAIRO_STATUS_SUCCESS;
+
     _cairo_surface_copy_pattern_for_destination (source,
 						 surface,
 						 &dev_source.base);


More information about the cairo-commit mailing list