emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/image.c,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/image.c,v
Date: Fri, 22 Feb 2008 17:42:15 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        08/02/22 17:42:10

Index: image.c
===================================================================
RCS file: /sources/emacs/emacs/src/image.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -b -r1.94 -r1.95
--- image.c     8 Jan 2008 20:44:27 -0000       1.94
+++ image.c     22 Feb 2008 17:42:08 -0000      1.95
@@ -1207,7 +1207,7 @@
 {
   if (img)
     {
-      struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
+      struct image_cache *c = FRAME_IMAGE_CACHE (f);
 
       /* Remove IMG from the hash table of its cache.  */
       if (img->prev)
@@ -1642,7 +1642,7 @@
      unsigned hash;
 {
   struct image *img;
-  struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
+  struct image_cache *c = FRAME_IMAGE_CACHE (f);
   int i = hash % IMAGE_CACHE_BUCKETS_SIZE;
 
   if (!c) return NULL;
@@ -1689,7 +1689,7 @@
 free_image_cache (f)
      struct frame *f;
 {
-  struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
+  struct image_cache *c = FRAME_IMAGE_CACHE (f);
   if (c)
     {
       int i;
@@ -1702,7 +1702,7 @@
       xfree (c->images);
       xfree (c->buckets);
       xfree (c);
-      FRAME_X_IMAGE_CACHE (f) = NULL;
+      FRAME_IMAGE_CACHE (f) = NULL;
     }
 }
 
@@ -1719,7 +1719,7 @@
      struct frame *f;
      int force_p;
 {
-  struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
+  struct image_cache *c = FRAME_IMAGE_CACHE (f);
 
   if (c && INTEGERP (Vimage_cache_eviction_delay))
     {
@@ -1756,8 +1756,7 @@
          FOR_EACH_FRAME (tail, frame)
            {
              struct frame *f = XFRAME (frame);
-             if (FRAME_WINDOW_P (f)
-                 && FRAME_X_IMAGE_CACHE (f) == c)
+             if (FRAME_IMAGE_CACHE (f) == c)
                clear_current_matrices (f);
            }
 
@@ -1768,6 +1767,18 @@
     }
 }
 
+void
+clear_image_caches (int force_p)
+{
+  /* FIXME: We want to do
+   * struct terminal *t;
+   * for (t = terminal_list; t; t = t->next_terminal)
+   *   clear_image_cache (t, filter); */
+  Lisp_Object tail, frame;
+  FOR_EACH_FRAME (tail, frame)
+    if (FRAME_WINDOW_P (XFRAME (frame)))
+      clear_image_cache (XFRAME (frame), force_p);
+}
 
 DEFUN ("clear-image-cache", Fclear_image_cache, Sclear_image_cache,
        0, 1, 0,
@@ -1778,13 +1789,7 @@
      Lisp_Object frame;
 {
   if (EQ (frame, Qt))
-    {
-      Lisp_Object tail;
-
-      FOR_EACH_FRAME (tail, frame)
-       if (FRAME_WINDOW_P (XFRAME (frame)))
-         clear_image_cache (XFRAME (frame), 1);
-    }
+    clear_image_caches (1);
   else
     clear_image_cache (check_x_frame (frame), 1);
 
@@ -1916,7 +1921,7 @@
   xassert (FRAME_WINDOW_P (f));
   xassert (valid_image_p (spec));
 
-  c = FRAME_X_IMAGE_CACHE (f);
+  c = FRAME_IMAGE_CACHE (f);
 
   GCPRO1 (spec);
 
@@ -2027,7 +2032,7 @@
      struct frame *f;
      struct image *img;
 {
-  struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
+  struct image_cache *c = FRAME_IMAGE_CACHE (f);
   int i;
 
   /* Find a free slot in c->images.  */
@@ -2062,21 +2067,28 @@
 /* Call FN on every image in the image cache of frame F.  Used to mark
    Lisp Objects in the image cache.  */
 
+/* Mark Lisp objects in image IMG.  */
+
+static void
+mark_image (img)
+     struct image *img;
+{
+  mark_object (img->spec);
+
+  if (!NILP (img->data.lisp_val))
+    mark_object (img->data.lisp_val);
+}
+
+
 void
-forall_images_in_image_cache (f, fn)
-     struct frame *f;
-     void (*fn) P_ ((struct image *img));
+mark_image_cache (struct image_cache *c)
 {
-  if (FRAME_LIVE_P (f) && FRAME_WINDOW_P (f))
-    {
-      struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
       if (c)
        {
          int i;
          for (i = 0; i < c->used; ++i)
            if (c->images[i])
-             fn (c->images[i]);
-       }
+         mark_image (c->images[i]);
     }
 }
 
@@ -8856,7 +8868,7 @@
      Pixmap pixmap;
      struct frame *f;
 {
-  struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
+  struct image_cache *c = FRAME_IMAGE_CACHE (f);
   int class, i;
   struct image *img;
 




reply via email to

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