bug 715798 pt 2.1 - add patch for huge emoji support to the gfx/cairo directory (NPOTB)
authorJonathan Kew <jkew@mozilla.com>
Tue, 23 Oct 2012 10:05:53 +0100
changeset 111262 f6988e710b96311910ce13fb01e117f8e4d34ed4
parent 111261 74f2eb49f209aed9889243af95e989f89ef9420b
child 111263 ce1cd7478dfe6e847f5bfdd6737b46f7afb9e6cb
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
bugs715798
milestone19.0a1
bug 715798 pt 2.1 - add patch for huge emoji support to the gfx/cairo directory (NPOTB)
gfx/cairo/README
gfx/cairo/use-show-text-glyphs-if-glyph-path-fails.patch
--- a/gfx/cairo/README
+++ b/gfx/cairo/README
@@ -213,11 +213,13 @@ pixman-lowres-interp.patch: Use lower qu
 pixman-bilinear-fastpath.patch: Bilinear fast paths for non-neon
 
 pixman-16-bit-pipeline.patch: 16 bit pipeline for dithering
 
 pixman-dither.patch: Add dithering of 16 bit gradients
 
 quartz-support-color-emoji-font.patch: support Apple Color Emoji font in cairo-quartz backend
 
+use-show-text-glyphs-if-glyph-path-fails.patch: fall back to show_text_glyphs even at huge sizes if scaled_font_glyph_path didn't work
+
 ==== disable printing patch ====
 
 disable-printing.patch:  allows us to use NS_PRINTING to disable printing.
new file mode 100644
--- /dev/null
+++ b/gfx/cairo/use-show-text-glyphs-if-glyph-path-fails.patch
@@ -0,0 +1,42 @@
+From: Jonathan Kew <jkew@mozilla.com>
+bug 715798 pt 2 - fall back to show_text_glyphs even at huge sizes if scaled_font_glyph_path didn't work. r=jrmuizel
+
+diff --git a/gfx/cairo/cairo/src/cairo-gstate.c b/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: