From b26f72fef99e9869a62cbb8e44a82837f87cf2c6 Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Thu, 24 Jun 2010 22:34:36 +0200 Subject: [PATCH] quartz: check return status If the font backend is unable to tell the extents of the operation, consider it unbound. --- src/cairo-quartz-surface.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c index 48603db1b..8c6fb7180 100644 --- a/src/cairo-quartz-surface.c +++ b/src/cairo-quartz-surface.c @@ -2490,6 +2490,7 @@ _cairo_quartz_surface_show_glyphs_cg (void *abstract_surface, CGGlyph *cg_glyphs = &glyphs_static[0]; CGSize *cg_advances = &cg_advances_static[0]; + cairo_rectangle_int_t glyph_extents; cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface; cairo_int_status_t rv = CAIRO_STATUS_SUCCESS; cairo_quartz_action_t action; @@ -2519,11 +2520,10 @@ _cairo_quartz_surface_show_glyphs_cg (void *abstract_surface, CGContextSaveGState (surface->cgContext); - if (_cairo_quartz_source_needs_extents (source)) + if (_cairo_quartz_source_needs_extents (source) && + !_cairo_scaled_font_glyph_device_extents (scaled_font, glyphs, num_glyphs, + &glyph_extents, NULL)) { - cairo_rectangle_int_t glyph_extents; - _cairo_scaled_font_glyph_device_extents (scaled_font, glyphs, num_glyphs, - &glyph_extents, NULL); action = _cairo_quartz_setup_source (surface, source, &glyph_extents); } else { action = _cairo_quartz_setup_source (surface, source, NULL);