comparison 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
comparison
equal deleted inserted replaced
92108:fc5344b71cdb 92109:4d9fc08769fa
892 892
893 #ifdef HAVE_WINDOW_SYSTEM 893 #ifdef HAVE_WINDOW_SYSTEM
894 /* Make the image cache. */ 894 /* Make the image cache. */
895 if (FRAME_WINDOW_P (f)) 895 if (FRAME_WINDOW_P (f))
896 { 896 {
897 if (FRAME_X_IMAGE_CACHE (f) == NULL) 897 if (FRAME_IMAGE_CACHE (f) == NULL)
898 FRAME_X_IMAGE_CACHE (f) = make_image_cache (); 898 /* Is that ever possible?? --Stef */
899 ++FRAME_X_IMAGE_CACHE (f)->refcount; 899 FRAME_IMAGE_CACHE (f) = make_image_cache ();
900 ++FRAME_IMAGE_CACHE (f)->refcount;
900 } 901 }
901 #endif /* HAVE_WINDOW_SYSTEM */ 902 #endif /* HAVE_WINDOW_SYSTEM */
902 903
903 /* Realize basic faces. Must have enough information in frame 904 /* Realize basic faces. Must have enough information in frame
904 parameters to realize basic faces at this point. */ 905 parameters to realize basic faces at this point. */
931 } 932 }
932 933
933 #ifdef HAVE_WINDOW_SYSTEM 934 #ifdef HAVE_WINDOW_SYSTEM
934 if (FRAME_WINDOW_P (f)) 935 if (FRAME_WINDOW_P (f))
935 { 936 {
936 struct image_cache *image_cache = FRAME_X_IMAGE_CACHE (f); 937 struct image_cache *image_cache = FRAME_IMAGE_CACHE (f);
937 if (image_cache) 938 if (image_cache)
938 { 939 {
939 --image_cache->refcount; 940 --image_cache->refcount;
940 if (image_cache->refcount == 0) 941 if (image_cache->refcount == 0)
941 free_image_cache (f); 942 free_image_cache (f);
1006 /* Clear GCs of realized faces. */ 1007 /* Clear GCs of realized faces. */
1007 FOR_EACH_FRAME (tail, frame) 1008 FOR_EACH_FRAME (tail, frame)
1008 { 1009 {
1009 f = XFRAME (frame); 1010 f = XFRAME (frame);
1010 if (FRAME_WINDOW_P (f)) 1011 if (FRAME_WINDOW_P (f))
1011 {
1012 clear_face_gcs (FRAME_FACE_CACHE (f)); 1012 clear_face_gcs (FRAME_FACE_CACHE (f));
1013 clear_image_cache (f, 0);
1014 }
1015 } 1013 }
1014 clear_image_caches (0);
1016 } 1015 }
1017 #endif /* HAVE_WINDOW_SYSTEM */ 1016 #endif /* HAVE_WINDOW_SYSTEM */
1018 } 1017 }
1019 1018
1020 1019