Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | From: Jonathan Kew <jkew@mozilla.com> |
michael@0 | 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 |
michael@0 | 3 | |
michael@0 | 4 | diff --git a/gfx/cairo/cairo/src/cairo-gstate.c b/gfx/cairo/cairo/src/cairo-gstate.c |
michael@0 | 5 | --- a/gfx/cairo/cairo/src/cairo-gstate.c |
michael@0 | 6 | +++ b/gfx/cairo/cairo/src/cairo-gstate.c |
michael@0 | 7 | @@ -2002,23 +2002,34 @@ cairo_status_t |
michael@0 | 8 | cairo_path_fixed_t path; |
michael@0 | 9 | |
michael@0 | 10 | _cairo_path_fixed_init (&path); |
michael@0 | 11 | |
michael@0 | 12 | status = _cairo_scaled_font_glyph_path (gstate->scaled_font, |
michael@0 | 13 | transformed_glyphs, num_glyphs, |
michael@0 | 14 | &path); |
michael@0 | 15 | |
michael@0 | 16 | - if (status == CAIRO_STATUS_SUCCESS) { |
michael@0 | 17 | + if (status == CAIRO_STATUS_SUCCESS && !_cairo_path_fixed_fill_is_empty (&path)) { |
michael@0 | 18 | status = _cairo_surface_fill (gstate->target, op, pattern, |
michael@0 | 19 | &path, |
michael@0 | 20 | CAIRO_FILL_RULE_WINDING, |
michael@0 | 21 | gstate->tolerance, |
michael@0 | 22 | gstate->scaled_font->options.antialias, |
michael@0 | 23 | _gstate_get_clip (gstate, &clip)); |
michael@0 | 24 | + } else { |
michael@0 | 25 | + /* if _cairo_scaled_font_glyph_path() failed, maybe the font doesn't support |
michael@0 | 26 | + * returning paths, so try the _cairo_surface_show_text_glyphs() option |
michael@0 | 27 | + */ |
michael@0 | 28 | + status = _cairo_surface_show_text_glyphs (gstate->target, op, pattern, |
michael@0 | 29 | + utf8, utf8_len, |
michael@0 | 30 | + transformed_glyphs, num_glyphs, |
michael@0 | 31 | + transformed_clusters, num_clusters, |
michael@0 | 32 | + cluster_flags, |
michael@0 | 33 | + gstate->scaled_font, |
michael@0 | 34 | + _gstate_get_clip (gstate, &clip)); |
michael@0 | 35 | } |
michael@0 | 36 | |
michael@0 | 37 | _cairo_path_fixed_fini (&path); |
michael@0 | 38 | } |
michael@0 | 39 | |
michael@0 | 40 | _cairo_clip_fini (&clip); |
michael@0 | 41 | |
michael@0 | 42 | CLEANUP_GLYPHS: |