bug 715798 pt 2 - fall back to show_text_glyphs even at huge sizes if scaled_font_glyph_path didn't work. r=jrmuizel
authorJonathan Kew <jkew@mozilla.com>
Tue, 23 Oct 2012 10:04:32 +0100
changeset 111129 74f2eb49f209aed9889243af95e989f89ef9420b
parent 111128 6b6cac8af7849f8d05bdec7082842d739a6cf926
child 111130 f6988e710b96311910ce13fb01e117f8e4d34ed4
push id23730
push userryanvm@gmail.com
push dateWed, 24 Oct 2012 02:28:59 +0000
treeherdermozilla-central@93cc1ee94291 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs715798
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 715798 pt 2 - fall back to show_text_glyphs even at huge sizes if scaled_font_glyph_path didn't work. r=jrmuizel
gfx/cairo/cairo/src/cairo-gstate.c
--- a/gfx/cairo/cairo/src/cairo-gstate.c
+++ b/gfx/cairo/cairo/src/cairo-gstate.c
@@ -2002,23 +2002,34 @@ cairo_status_t
 	cairo_path_fixed_t path;
 
 	_cairo_path_fixed_init (&path);
 
 	status = _cairo_scaled_font_glyph_path (gstate->scaled_font,
 						transformed_glyphs, num_glyphs,
 						&path);
 
-	if (status == CAIRO_STATUS_SUCCESS) {
+	if (status == CAIRO_STATUS_SUCCESS && !_cairo_path_fixed_fill_is_empty (&path)) {
 	    status = _cairo_surface_fill (gstate->target, op, pattern,
 					  &path,
 					  CAIRO_FILL_RULE_WINDING,
 					  gstate->tolerance,
 					  gstate->scaled_font->options.antialias,
 					  _gstate_get_clip (gstate, &clip));
+	} else {
+	    /* if _cairo_scaled_font_glyph_path() failed, maybe the font doesn't support
+	     * returning paths, so try the _cairo_surface_show_text_glyphs() option
+	     */
+	    status = _cairo_surface_show_text_glyphs (gstate->target, op, pattern,
+						      utf8, utf8_len,
+						      transformed_glyphs, num_glyphs,
+						      transformed_clusters, num_clusters,
+						      cluster_flags,
+						      gstate->scaled_font,
+						      _gstate_get_clip (gstate, &clip));
 	}
 
 	_cairo_path_fixed_fini (&path);
     }
 
     _cairo_clip_fini (&clip);
 
 CLEANUP_GLYPHS: