1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/cairo/use-show-text-glyphs-if-glyph-path-fails.patch Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,42 @@ 1.4 +From: Jonathan Kew <jkew@mozilla.com> 1.5 +bug 715798 pt 2 - fall back to show_text_glyphs even at huge sizes if scaled_font_glyph_path didn't work. r=jrmuizel 1.6 + 1.7 +diff --git a/gfx/cairo/cairo/src/cairo-gstate.c b/gfx/cairo/cairo/src/cairo-gstate.c 1.8 +--- a/gfx/cairo/cairo/src/cairo-gstate.c 1.9 ++++ b/gfx/cairo/cairo/src/cairo-gstate.c 1.10 +@@ -2002,23 +2002,34 @@ cairo_status_t 1.11 + cairo_path_fixed_t path; 1.12 + 1.13 + _cairo_path_fixed_init (&path); 1.14 + 1.15 + status = _cairo_scaled_font_glyph_path (gstate->scaled_font, 1.16 + transformed_glyphs, num_glyphs, 1.17 + &path); 1.18 + 1.19 +- if (status == CAIRO_STATUS_SUCCESS) { 1.20 ++ if (status == CAIRO_STATUS_SUCCESS && !_cairo_path_fixed_fill_is_empty (&path)) { 1.21 + status = _cairo_surface_fill (gstate->target, op, pattern, 1.22 + &path, 1.23 + CAIRO_FILL_RULE_WINDING, 1.24 + gstate->tolerance, 1.25 + gstate->scaled_font->options.antialias, 1.26 + _gstate_get_clip (gstate, &clip)); 1.27 ++ } else { 1.28 ++ /* if _cairo_scaled_font_glyph_path() failed, maybe the font doesn't support 1.29 ++ * returning paths, so try the _cairo_surface_show_text_glyphs() option 1.30 ++ */ 1.31 ++ status = _cairo_surface_show_text_glyphs (gstate->target, op, pattern, 1.32 ++ utf8, utf8_len, 1.33 ++ transformed_glyphs, num_glyphs, 1.34 ++ transformed_clusters, num_clusters, 1.35 ++ cluster_flags, 1.36 ++ gstate->scaled_font, 1.37 ++ _gstate_get_clip (gstate, &clip)); 1.38 + } 1.39 + 1.40 + _cairo_path_fixed_fini (&path); 1.41 + } 1.42 + 1.43 + _cairo_clip_fini (&clip); 1.44 + 1.45 + CLEANUP_GLYPHS: