diff src/xfaces.c @ 92109:4d9fc08769fa

Consolidate the image_cache to the terminal struct. * termhooks.h (P_): Remove redundant def. (struct terminal): New field `image_cache'. * frame.h (FRAME_IMAGE_CACHE): New macro. Use it everywhere in place of FRAME_X_IMAGE_CACHE. * xterm.h (struct x_display_info): Remove image_cache field. (FRAME_X_IMAGE_CACHE): Remove. Use FRAME_IMAGE_CACHE instead. * w32term.h (struct w32_display_info): Remove image_cache field. (FRAME_X_IMAGE_CACHE): Remove. Use FRAME_IMAGE_CACHE instead. * macterm.h (struct mac_display_info): Remove image_cache field. (FRAME_X_IMAGE_CACHE): Remove. Use FRAME_IMAGE_CACHE instead. * xterm.c (x_term_init): * w32term.c (w32_term_init): * macterm.c (mac_term_init): Set the image_cache in the terminal. * dispextern.h (clear_image_cache, forall_images_in_image_cache): Remove declarations. (clear_image_caches, mark_image_cache): New declarations. * xfaces.c (clear_face_cache): * xdisp.c (redisplay_internal): Use clear_image_caches. * image.c (clear_image_cache): Don't check that a frame is on a window-system before checking if it shares the same cache. (clear_image_caches): New function. (Fclear_image_cache): Use it. (mark_image): Move from allo.c. (mark_image_cache): Move from alloc.c and forall_images_in_image_cache. * alloc.c (mark_image, mark_image_cache): Move to image.c. (mark_object): Don't call mark_image_cache for frames. (mark_terminals): Call mark_image_cache.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 22 Feb 2008 17:42:09 +0000
parents da78ada8c491
children 1c088baa9d2d
line wrap: on
line diff
--- a/src/xfaces.c	Fri Feb 22 17:27:17 2008 +0000
+++ b/src/xfaces.c	Fri Feb 22 17:42:09 2008 +0000
@@ -894,9 +894,10 @@
   /* Make the image cache.  */
   if (FRAME_WINDOW_P (f))
     {
-      if (FRAME_X_IMAGE_CACHE (f) == NULL)
-	FRAME_X_IMAGE_CACHE (f) = make_image_cache ();
-      ++FRAME_X_IMAGE_CACHE (f)->refcount;
+      if (FRAME_IMAGE_CACHE (f) == NULL)
+	/* Is that ever possible??  --Stef  */
+	FRAME_IMAGE_CACHE (f) = make_image_cache ();
+      ++FRAME_IMAGE_CACHE (f)->refcount;
     }
 #endif /* HAVE_WINDOW_SYSTEM */
 
@@ -933,7 +934,7 @@
 #ifdef HAVE_WINDOW_SYSTEM
   if (FRAME_WINDOW_P (f))
     {
-      struct image_cache *image_cache = FRAME_X_IMAGE_CACHE (f);
+      struct image_cache *image_cache = FRAME_IMAGE_CACHE (f);
       if (image_cache)
 	{
 	  --image_cache->refcount;
@@ -1008,11 +1009,9 @@
 	{
 	  f = XFRAME (frame);
 	  if (FRAME_WINDOW_P (f))
-	    {
 	      clear_face_gcs (FRAME_FACE_CACHE (f));
-	      clear_image_cache (f, 0);
-	    }
 	}
+      clear_image_caches (0);
     }
 #endif /* HAVE_WINDOW_SYSTEM */
 }