mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 491595. Use path filling instead of platform glyph rasterization at a smaller size threshold of 256 device pixels, if the backend supports native filling (which we assume will be fast). r=vlad
--HG-- extra : rebase_source : 65728f993e0db12ec699203c5d3f711a6b51fb6e
This commit is contained in:
parent
1942f8e50b
commit
bf982f14fd
@ -48,6 +48,8 @@ wrap-source_image.patch: make sure we don't free the source image until we're do
|
||||
|
||||
zero-sized.patch: deal with zero sized surface in ways less likely to crash.
|
||||
|
||||
text-path-filling-threshold.patch: use path filling instead of platform glyph rasterization at a smaller size threshold of 256 device pixels, if the backend supports native filling (which we assume will be fast).
|
||||
|
||||
==== pixman patches ====
|
||||
|
||||
pixman-neon.patch: add ARM NEON optimized compositing functions
|
||||
|
@ -1678,16 +1678,20 @@ _cairo_gstate_show_text_glyphs (cairo_gstate_t *gstate,
|
||||
|
||||
/* For really huge font sizes, we can just do path;fill instead of
|
||||
* show_glyphs, as show_glyphs would put excess pressure on the cache,
|
||||
* and moreover, not all components below us correctly handle huge font
|
||||
* sizes. I wanted to set the limit at 256. But alas, seems like cairo's
|
||||
* not all components below us correctly handle huge font sizes, and
|
||||
* path filling can be cheaper since parts of glyphs are likely to be
|
||||
* clipped out. 256 seems like a good limit. But alas, seems like cairo's
|
||||
* rasterizer is something like ten times slower than freetype's for huge
|
||||
* sizes. So, no win just yet. For now, do it for insanely-huge sizes,
|
||||
* just to make sure we don't make anyone unhappy. When we get a really
|
||||
* fast rasterizer in cairo, we may want to readjust this.
|
||||
* sizes. So, no win just yet when we're using cairo's rasterizer.
|
||||
* For now, if we're using cairo's rasterizer, use path filling only
|
||||
* for insanely-huge sizes, just to make sure we don't make anyone
|
||||
* unhappy. When we get a really fast rasterizer in cairo, we may
|
||||
* want to readjust this.
|
||||
*
|
||||
* Needless to say, do this only if show_text_glyphs is not available. */
|
||||
int path_fill_threshold = gstate->target->backend->fill ? 256 : 10240;
|
||||
if (cairo_surface_has_show_text_glyphs (gstate->target) ||
|
||||
_cairo_scaled_font_get_max_scale (gstate->scaled_font) <= 10240) {
|
||||
_cairo_scaled_font_get_max_scale (gstate->scaled_font) <= path_fill_threshold) {
|
||||
status = _cairo_surface_show_text_glyphs (gstate->target,
|
||||
gstate->op,
|
||||
source_pattern,
|
||||
|
40
gfx/cairo/text-path-filling-threshold.patch
Normal file
40
gfx/cairo/text-path-filling-threshold.patch
Normal file
@ -0,0 +1,40 @@
|
||||
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
|
||||
@@ -1673,26 +1673,30 @@ _cairo_gstate_show_text_glyphs (cairo_gs
|
||||
|
||||
source_pattern = &source_pattern_stack.base;
|
||||
status = _cairo_gstate_copy_transformed_source (gstate, &source_pattern);
|
||||
if (unlikely (status))
|
||||
goto CLEANUP_GLYPHS;
|
||||
|
||||
/* For really huge font sizes, we can just do path;fill instead of
|
||||
* show_glyphs, as show_glyphs would put excess pressure on the cache,
|
||||
- * and moreover, not all components below us correctly handle huge font
|
||||
- * sizes. I wanted to set the limit at 256. But alas, seems like cairo's
|
||||
+ * not all components below us correctly handle huge font sizes, and
|
||||
+ * path filling can be cheaper since parts of glyphs are likely to be
|
||||
+ * clipped out. 256 seems like a good limit. But alas, seems like cairo's
|
||||
* rasterizer is something like ten times slower than freetype's for huge
|
||||
- * sizes. So, no win just yet. For now, do it for insanely-huge sizes,
|
||||
- * just to make sure we don't make anyone unhappy. When we get a really
|
||||
- * fast rasterizer in cairo, we may want to readjust this.
|
||||
+ * sizes. So, no win just yet when we're using cairo's rasterizer.
|
||||
+ * For now, if we're using cairo's rasterizer, use path filling only
|
||||
+ * for insanely-huge sizes, just to make sure we don't make anyone
|
||||
+ * unhappy. When we get a really fast rasterizer in cairo, we may
|
||||
+ * want to readjust this.
|
||||
*
|
||||
* Needless to say, do this only if show_text_glyphs is not available. */
|
||||
+ int path_fill_threshold = gstate->target->backend->fill ? 256 : 10240;
|
||||
if (cairo_surface_has_show_text_glyphs (gstate->target) ||
|
||||
- _cairo_scaled_font_get_max_scale (gstate->scaled_font) <= 10240) {
|
||||
+ _cairo_scaled_font_get_max_scale (gstate->scaled_font) <= path_fill_threshold) {
|
||||
status = _cairo_surface_show_text_glyphs (gstate->target,
|
||||
gstate->op,
|
||||
source_pattern,
|
||||
utf8, utf8_len,
|
||||
transformed_glyphs, num_glyphs,
|
||||
transformed_clusters, num_clusters,
|
||||
cluster_flags,
|
||||
gstate->scaled_font, NULL);
|
Loading…
Reference in New Issue
Block a user