diff options
| author | Dmitry Antipov | 2013-08-13 12:18:11 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-08-13 12:18:11 +0400 |
| commit | a45543bc75e845c9217130c65ddd00a81c18ffd1 (patch) | |
| tree | 2d09d300e4d7c211389215e2c991c57162689d47 /src | |
| parent | ae966a860afc2d7ebbb1e96a68c2df3cfbdc2b81 (diff) | |
| download | emacs-a45543bc75e845c9217130c65ddd00a81c18ffd1.tar.gz emacs-a45543bc75e845c9217130c65ddd00a81c18ffd1.zip | |
* font.c (clear_font_cache): New function, stripped from...
(Fclear_font_cache): ...here, which now uses the function
above. Adjust comment.
* font.h (clear_font_cache): Add prototype.
* xfaces.c (clear_face_cache): Use clear_font_cache.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/font.c | 50 | ||||
| -rw-r--r-- | src/font.h | 1 | ||||
| -rw-r--r-- | src/xfaces.c | 10 |
4 files changed, 39 insertions, 30 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 32b0eb209c9..74af248575a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,13 @@ | |||
| 1 | 2013-08-13 Dmitry Antipov <dmantipov@yandex.ru> | 1 | 2013-08-13 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 2 | ||
| 3 | * font.c (clear_font_cache): New function, stripped from... | ||
| 4 | (Fclear_font_cache): ...here, which now uses the function | ||
| 5 | above. Adjust comment. | ||
| 6 | * font.h (clear_font_cache): Add prototype. | ||
| 7 | * xfaces.c (clear_face_cache): Use clear_font_cache. | ||
| 8 | |||
| 9 | 2013-08-13 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 10 | |||
| 3 | * window.c (Fset_window_start): Compare `w', not `window' because | 11 | * window.c (Fset_window_start): Compare `w', not `window' because |
| 4 | `w' might not be equal to `window' after call to decode_live_window. | 12 | `w' might not be equal to `window' after call to decode_live_window. |
| 5 | 13 | ||
diff --git a/src/font.c b/src/font.c index 073487b540d..6a8262623dc 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -4226,36 +4226,38 @@ the consecutive wildcards are folded into one. */) | |||
| 4226 | return make_string (name, namelen); | 4226 | return make_string (name, namelen); |
| 4227 | } | 4227 | } |
| 4228 | 4228 | ||
| 4229 | void | ||
| 4230 | clear_font_cache (struct frame *f) | ||
| 4231 | { | ||
| 4232 | struct font_driver_list *driver_list = f->font_driver_list; | ||
| 4233 | |||
| 4234 | for (; driver_list; driver_list = driver_list->next) | ||
| 4235 | if (driver_list->on) | ||
| 4236 | { | ||
| 4237 | Lisp_Object val, tmp, cache = driver_list->driver->get_cache (f); | ||
| 4238 | |||
| 4239 | val = XCDR (cache); | ||
| 4240 | while (! NILP (val) | ||
| 4241 | && ! EQ (XCAR (XCAR (val)), driver_list->driver->type)) | ||
| 4242 | val = XCDR (val); | ||
| 4243 | eassert (! NILP (val)); | ||
| 4244 | tmp = XCDR (XCAR (val)); | ||
| 4245 | if (XINT (XCAR (tmp)) == 0) | ||
| 4246 | { | ||
| 4247 | font_clear_cache (f, XCAR (val), driver_list->driver); | ||
| 4248 | XSETCDR (cache, XCDR (val)); | ||
| 4249 | } | ||
| 4250 | } | ||
| 4251 | } | ||
| 4252 | |||
| 4229 | DEFUN ("clear-font-cache", Fclear_font_cache, Sclear_font_cache, 0, 0, 0, | 4253 | DEFUN ("clear-font-cache", Fclear_font_cache, Sclear_font_cache, 0, 0, 0, |
| 4230 | doc: /* Clear font cache. */) | 4254 | doc: /* Clear font cache of each frame. */) |
| 4231 | (void) | 4255 | (void) |
| 4232 | { | 4256 | { |
| 4233 | Lisp_Object list, frame; | 4257 | Lisp_Object list, frame; |
| 4234 | 4258 | ||
| 4235 | FOR_EACH_FRAME (list, frame) | 4259 | FOR_EACH_FRAME (list, frame) |
| 4236 | { | 4260 | clear_font_cache (XFRAME (frame)); |
| 4237 | struct frame *f = XFRAME (frame); | ||
| 4238 | struct font_driver_list *driver_list = f->font_driver_list; | ||
| 4239 | |||
| 4240 | for (; driver_list; driver_list = driver_list->next) | ||
| 4241 | if (driver_list->on) | ||
| 4242 | { | ||
| 4243 | Lisp_Object cache = driver_list->driver->get_cache (f); | ||
| 4244 | Lisp_Object val, tmp; | ||
| 4245 | |||
| 4246 | val = XCDR (cache); | ||
| 4247 | while (! NILP (val) | ||
| 4248 | && ! EQ (XCAR (XCAR (val)), driver_list->driver->type)) | ||
| 4249 | val = XCDR (val); | ||
| 4250 | eassert (! NILP (val)); | ||
| 4251 | tmp = XCDR (XCAR (val)); | ||
| 4252 | if (XINT (XCAR (tmp)) == 0) | ||
| 4253 | { | ||
| 4254 | font_clear_cache (f, XCAR (val), driver_list->driver); | ||
| 4255 | XSETCDR (cache, XCDR (val)); | ||
| 4256 | } | ||
| 4257 | } | ||
| 4258 | } | ||
| 4259 | 4261 | ||
| 4260 | return Qnil; | 4262 | return Qnil; |
| 4261 | } | 4263 | } |
diff --git a/src/font.h b/src/font.h index daeb320c1ab..adb4a582fd8 100644 --- a/src/font.h +++ b/src/font.h | |||
| @@ -760,6 +760,7 @@ extern Lisp_Object font_load_for_lface (struct frame *f, Lisp_Object *lface, | |||
| 760 | Lisp_Object spec); | 760 | Lisp_Object spec); |
| 761 | extern void font_prepare_for_face (struct frame *f, struct face *face); | 761 | extern void font_prepare_for_face (struct frame *f, struct face *face); |
| 762 | extern void font_done_for_face (struct frame *f, struct face *face); | 762 | extern void font_done_for_face (struct frame *f, struct face *face); |
| 763 | extern void clear_font_cache (struct frame *); | ||
| 763 | 764 | ||
| 764 | extern Lisp_Object font_open_by_spec (struct frame *f, Lisp_Object spec); | 765 | extern Lisp_Object font_open_by_spec (struct frame *f, Lisp_Object spec); |
| 765 | extern Lisp_Object font_open_by_name (struct frame *f, Lisp_Object name); | 766 | extern Lisp_Object font_open_by_name (struct frame *f, Lisp_Object name); |
diff --git a/src/xfaces.c b/src/xfaces.c index acd2d2b1116..b76f9d24180 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -759,11 +759,6 @@ clear_face_cache (int clear_fonts_p) | |||
| 759 | if (clear_fonts_p | 759 | if (clear_fonts_p |
| 760 | || ++clear_font_table_count == CLEAR_FONT_TABLE_COUNT) | 760 | || ++clear_font_table_count == CLEAR_FONT_TABLE_COUNT) |
| 761 | { | 761 | { |
| 762 | #if 0 | ||
| 763 | /* Not yet implemented. */ | ||
| 764 | clear_font_cache (frame); | ||
| 765 | #endif | ||
| 766 | |||
| 767 | /* From time to time see if we can unload some fonts. This also | 762 | /* From time to time see if we can unload some fonts. This also |
| 768 | frees all realized faces on all frames. Fonts needed by | 763 | frees all realized faces on all frames. Fonts needed by |
| 769 | faces will be loaded again when faces are realized again. */ | 764 | faces will be loaded again when faces are realized again. */ |
| @@ -774,7 +769,10 @@ clear_face_cache (int clear_fonts_p) | |||
| 774 | struct frame *f = XFRAME (frame); | 769 | struct frame *f = XFRAME (frame); |
| 775 | if (FRAME_WINDOW_P (f) | 770 | if (FRAME_WINDOW_P (f) |
| 776 | && FRAME_X_DISPLAY_INFO (f)->n_fonts > CLEAR_FONT_TABLE_NFONTS) | 771 | && FRAME_X_DISPLAY_INFO (f)->n_fonts > CLEAR_FONT_TABLE_NFONTS) |
| 777 | free_all_realized_faces (frame); | 772 | { |
| 773 | clear_font_cache (f); | ||
| 774 | free_all_realized_faces (frame); | ||
| 775 | } | ||
| 778 | } | 776 | } |
| 779 | } | 777 | } |
| 780 | else | 778 | else |