|
1 From: Jonathan Kew <jkew@mozilla.com> |
|
2 bug 715798 pt 2 - fall back to show_text_glyphs even at huge sizes if scaled_font_glyph_path didn't work. r=jrmuizel |
|
3 |
|
4 diff --git a/gfx/cairo/cairo/src/cairo-gstate.c b/gfx/cairo/cairo/src/cairo-gstate.c |
|
5 --- a/gfx/cairo/cairo/src/cairo-gstate.c |
|
6 +++ b/gfx/cairo/cairo/src/cairo-gstate.c |
|
7 @@ -2002,23 +2002,34 @@ cairo_status_t |
|
8 cairo_path_fixed_t path; |
|
9 |
|
10 _cairo_path_fixed_init (&path); |
|
11 |
|
12 status = _cairo_scaled_font_glyph_path (gstate->scaled_font, |
|
13 transformed_glyphs, num_glyphs, |
|
14 &path); |
|
15 |
|
16 - if (status == CAIRO_STATUS_SUCCESS) { |
|
17 + if (status == CAIRO_STATUS_SUCCESS && !_cairo_path_fixed_fill_is_empty (&path)) { |
|
18 status = _cairo_surface_fill (gstate->target, op, pattern, |
|
19 &path, |
|
20 CAIRO_FILL_RULE_WINDING, |
|
21 gstate->tolerance, |
|
22 gstate->scaled_font->options.antialias, |
|
23 _gstate_get_clip (gstate, &clip)); |
|
24 + } else { |
|
25 + /* if _cairo_scaled_font_glyph_path() failed, maybe the font doesn't support |
|
26 + * returning paths, so try the _cairo_surface_show_text_glyphs() option |
|
27 + */ |
|
28 + status = _cairo_surface_show_text_glyphs (gstate->target, op, pattern, |
|
29 + utf8, utf8_len, |
|
30 + transformed_glyphs, num_glyphs, |
|
31 + transformed_clusters, num_clusters, |
|
32 + cluster_flags, |
|
33 + gstate->scaled_font, |
|
34 + _gstate_get_clip (gstate, &clip)); |
|
35 } |
|
36 |
|
37 _cairo_path_fixed_fini (&path); |
|
38 } |
|
39 |
|
40 _cairo_clip_fini (&clip); |
|
41 |
|
42 CLEANUP_GLYPHS: |