changeset 81398:f9305411500d

(search_image_cache): Remove unused variable.
author Chong Yidong <cyd@stupidchicken.com>
date Thu, 14 Jun 2007 01:48:01 +0000
parents d864ac190c46
children 800f2a9f57ba
files src/image.c
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/image.c	Thu Jun 14 01:47:53 2007 +0000
+++ b/src/image.c	Thu Jun 14 01:48:01 2007 +0000
@@ -1642,21 +1642,26 @@
 {
   struct image *img;
   struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
-  Lisp_Object specified_bg = image_spec_value (spec, QCbackground, NULL);
   int i = hash % IMAGE_CACHE_BUCKETS_SIZE;
 
   /* If the image spec does not specify a background color, the cached
      image must have the same background color as the current frame.
-     Likewise for the foreground color of the cached monochrome image.
-     The following code be improved.  For example, jpeg does not
-     support transparency, but currently a jpeg image spec won't match
-     a cached spec created with a different frame background.  The
-     extra memory usage is probably negligible in practice.  */
+     The foreground color must also match, for the sake of monochrome
+     images.
+
+     In fact, we could ignore the foreground color matching condition
+     for color images, or if the image spec specifies :foreground;
+     similarly we could ignore the background color matching condition
+     for formats that don't use transparency (such as jpeg), or if the
+     image spec specifies :background.  However, the extra memory
+     usage is probably negligible in practice, so we don't bother.  */
   if (!c) return NULL;
 
   for (img = c->buckets[i]; img; img = img->next)
     if (img->hash == hash
 	&& !NILP (Fequal (img->spec, spec))
+	/* If the image spec specifies a background, it doesn't matter
+	   what the frame background is.  */
 	&& img->frame_foreground == FRAME_FOREGROUND_PIXEL (f)
 	&& img->frame_background == FRAME_BACKGROUND_PIXEL (f))
       break;