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: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/src/image.c,v
Date: Thu, 14 Jun 2007 01:48:01 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      07/06/14 01:48:01

Index: image.c
===================================================================
RCS file: /sources/emacs/emacs/src/image.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -b -r1.72 -r1.73
--- image.c     13 Jun 2007 08:21:44 -0000      1.72
+++ image.c     14 Jun 2007 01:48:01 -0000      1.73
@@ -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;




reply via email to

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