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.
This commit is contained in:
Behdad Esfahbod 2006-12-23 17:08:04 -05:00
parent 3212fc4f0f
commit 8fd7328ebb
2 changed files with 6 additions and 0 deletions

View file

@ -920,6 +920,9 @@ _cairo_scaled_font_show_glyphs (cairo_scaled_font_t *scaled_font,
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,

View file

@ -1812,6 +1812,9 @@ _cairo_surface_show_glyphs (cairo_surface_t *surface,
return CAIRO_STATUS_NO_MEMORY;
}
if (!num_glyphs)
return CAIRO_STATUS_SUCCESS;
_cairo_surface_copy_pattern_for_destination (source,
surface,
&dev_source.base);