mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-07 05:30:19 +01:00
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:
parent
3212fc4f0f
commit
8fd7328ebb
2 changed files with 6 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue