emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r113836: * font.c (clear_font_cache): New function,


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r113836: * font.c (clear_font_cache): New function, stripped from...
Date: Tue, 13 Aug 2013 08:20:05 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113836
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Tue 2013-08-13 12:18:11 +0400
message:
  * 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.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/font.c                     font.c-20091113204419-o5vbwnq5f7feedwu-8540
  src/font.h                     font.h-20091113204419-o5vbwnq5f7feedwu-8541
  src/xfaces.c                   xfaces.c-20091113204419-o5vbwnq5f7feedwu-560
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-08-13 08:17:50 +0000
+++ b/src/ChangeLog     2013-08-13 08:18:11 +0000
@@ -1,5 +1,13 @@
 2013-08-13  Dmitry Antipov  <address@hidden>
 
+       * 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.
+
+2013-08-13  Dmitry Antipov  <address@hidden>
+
        * window.c (Fset_window_start): Compare `w', not `window' because
        `w' might not be equal to `window' after call to decode_live_window.
 

=== modified file 'src/font.c'
--- a/src/font.c        2013-08-03 03:29:03 +0000
+++ b/src/font.c        2013-08-13 08:18:11 +0000
@@ -4226,36 +4226,38 @@
   return make_string (name, namelen);
 }
 
+void
+clear_font_cache (struct frame *f)
+{
+  struct font_driver_list *driver_list = f->font_driver_list;
+
+  for (; driver_list; driver_list = driver_list->next)
+    if (driver_list->on)
+      {
+       Lisp_Object val, tmp, cache = driver_list->driver->get_cache (f);
+
+       val = XCDR (cache);
+       while (! NILP (val)
+              && ! EQ (XCAR (XCAR (val)), driver_list->driver->type))
+         val = XCDR (val);
+       eassert (! NILP (val));
+       tmp = XCDR (XCAR (val));
+       if (XINT (XCAR (tmp)) == 0)
+         {
+           font_clear_cache (f, XCAR (val), driver_list->driver);
+           XSETCDR (cache, XCDR (val));
+         }
+      }
+}
+
 DEFUN ("clear-font-cache", Fclear_font_cache, Sclear_font_cache, 0, 0, 0,
-       doc: /* Clear font cache.  */)
+       doc: /* Clear font cache of each frame.  */)
   (void)
 {
   Lisp_Object list, frame;
 
   FOR_EACH_FRAME (list, frame)
-    {
-      struct frame *f = XFRAME (frame);
-      struct font_driver_list *driver_list = f->font_driver_list;
-
-      for (; driver_list; driver_list = driver_list->next)
-       if (driver_list->on)
-         {
-           Lisp_Object cache = driver_list->driver->get_cache (f);
-           Lisp_Object val, tmp;
-
-           val = XCDR (cache);
-           while (! NILP (val)
-                  && ! EQ (XCAR (XCAR (val)), driver_list->driver->type))
-             val = XCDR (val);
-           eassert (! NILP (val));
-           tmp = XCDR (XCAR (val));
-           if (XINT (XCAR (tmp)) == 0)
-             {
-               font_clear_cache (f, XCAR (val), driver_list->driver);
-               XSETCDR (cache, XCDR (val));
-             }
-         }
-    }
+    clear_font_cache (XFRAME (frame));
 
   return Qnil;
 }

=== modified file 'src/font.h'
--- a/src/font.h        2013-08-03 03:29:03 +0000
+++ b/src/font.h        2013-08-13 08:18:11 +0000
@@ -760,6 +760,7 @@
                                         Lisp_Object spec);
 extern void font_prepare_for_face (struct frame *f, struct face *face);
 extern void font_done_for_face (struct frame *f, struct face *face);
+extern void clear_font_cache (struct frame *);
 
 extern Lisp_Object font_open_by_spec (struct frame *f, Lisp_Object spec);
 extern Lisp_Object font_open_by_name (struct frame *f, Lisp_Object name);

=== modified file 'src/xfaces.c'
--- a/src/xfaces.c      2013-08-03 03:29:03 +0000
+++ b/src/xfaces.c      2013-08-13 08:18:11 +0000
@@ -759,11 +759,6 @@
   if (clear_fonts_p
       || ++clear_font_table_count == CLEAR_FONT_TABLE_COUNT)
     {
-#if 0
-      /* Not yet implemented.  */
-      clear_font_cache (frame);
-#endif
-
       /* From time to time see if we can unload some fonts.  This also
         frees all realized faces on all frames.  Fonts needed by
         faces will be loaded again when faces are realized again.  */
@@ -774,7 +769,10 @@
          struct frame *f = XFRAME (frame);
          if (FRAME_WINDOW_P (f)
              && FRAME_X_DISPLAY_INFO (f)->n_fonts > CLEAR_FONT_TABLE_NFONTS)
-           free_all_realized_faces (frame);
+           {
+             clear_font_cache (f);
+             free_all_realized_faces (frame);
+           }
        }
     }
   else


reply via email to

[Prev in Thread] Current Thread [Next in Thread]