diff options
| author | Eli Zaretskii | 2017-04-16 10:43:22 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-04-16 10:43:22 +0300 |
| commit | 58430f29968a5661caff630d20dbbe7c864fe08d (patch) | |
| tree | 8ec9d9d392f08b16e39c1d3c5a5c5824d5239a60 /src | |
| parent | f3b24e90dc9fad355102e1fdf2828ca33d447a07 (diff) | |
| download | emacs-58430f29968a5661caff630d20dbbe7c864fe08d.tar.gz emacs-58430f29968a5661caff630d20dbbe7c864fe08d.zip | |
Fix redisplay performance problems with some fonts
* src/font.c (font_list_entities): Revert part of the changes
introduced on Apr 2, 2014 to fix bug#17125. It turns out having
zero_vector in the font-cache is an important indication that
cannot be removed. (Bug#21028)
Diffstat (limited to 'src')
| -rw-r--r-- | src/font.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/font.c b/src/font.c index a929509752c..dd6191b2b1f 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -2777,21 +2777,27 @@ font_list_entities (struct frame *f, Lisp_Object spec) | |||
| 2777 | val = XCDR (val); | 2777 | val = XCDR (val); |
| 2778 | else | 2778 | else |
| 2779 | { | 2779 | { |
| 2780 | val = driver_list->driver->list (f, scratch_font_spec); | 2780 | Lisp_Object copy; |
| 2781 | if (!NILP (val)) | ||
| 2782 | { | ||
| 2783 | Lisp_Object copy = copy_font_spec (scratch_font_spec); | ||
| 2784 | 2781 | ||
| 2785 | val = Fvconcat (1, &val); | 2782 | val = driver_list->driver->list (f, scratch_font_spec); |
| 2786 | ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type); | 2783 | /* We put zero_vector in the font-cache to indicate that |
| 2787 | XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache))); | 2784 | no fonts matching SPEC were found on the system. |
| 2788 | } | 2785 | Failure to have this indication in the font cache can |
| 2786 | cause severe performance degradation in some rare | ||
| 2787 | cases, see bug#21028. */ | ||
| 2788 | if (NILP (val)) | ||
| 2789 | val = zero_vector; | ||
| 2790 | else | ||
| 2791 | val = Fvconcat (1, &val); | ||
| 2792 | copy = copy_font_spec (scratch_font_spec); | ||
| 2793 | ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type); | ||
| 2794 | XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache))); | ||
| 2789 | } | 2795 | } |
| 2790 | if (VECTORP (val) && ASIZE (val) > 0 | 2796 | if (ASIZE (val) > 0 |
| 2791 | && (need_filtering | 2797 | && (need_filtering |
| 2792 | || ! NILP (Vface_ignored_fonts))) | 2798 | || ! NILP (Vface_ignored_fonts))) |
| 2793 | val = font_delete_unmatched (val, need_filtering ? spec : Qnil, size); | 2799 | val = font_delete_unmatched (val, need_filtering ? spec : Qnil, size); |
| 2794 | if (VECTORP (val) && ASIZE (val) > 0) | 2800 | if (ASIZE (val) > 0) |
| 2795 | list = Fcons (val, list); | 2801 | list = Fcons (val, list); |
| 2796 | } | 2802 | } |
| 2797 | 2803 | ||