aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2007-06-13 08:22:12 +0000
committerYAMAMOTO Mitsuharu2007-06-13 08:22:12 +0000
commitc5b8e0eaed770ea7ddb85810bafeab9c15b7de92 (patch)
tree1cf8103f32aed2d807c15d127a62a93bdb04be2c /src/image.c
parentf6b5464848c7a3d6aff921eed4df7e00f8000326 (diff)
downloademacs-c5b8e0eaed770ea7ddb85810bafeab9c15b7de92.tar.gz
emacs-c5b8e0eaed770ea7ddb85810bafeab9c15b7de92.zip
(lookup_image): Save frame foreground and background colors.
(search_image_cache): Check if saved and current frame colors match.
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/image.c b/src/image.c
index 9cfcd5a63f8..36e8a2ecb80 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1647,6 +1647,7 @@ search_image_cache (f, spec, hash)
1647 1647
1648 /* If the image spec does not specify a background color, the cached 1648 /* If the image spec does not specify a background color, the cached
1649 image must have the same background color as the current frame. 1649 image must have the same background color as the current frame.
1650 Likewise for the foreground color of the cached monochrome image.
1650 The following code be improved. For example, jpeg does not 1651 The following code be improved. For example, jpeg does not
1651 support transparency, but currently a jpeg image spec won't match 1652 support transparency, but currently a jpeg image spec won't match
1652 a cached spec created with a different frame background. The 1653 a cached spec created with a different frame background. The
@@ -1656,8 +1657,8 @@ search_image_cache (f, spec, hash)
1656 for (img = c->buckets[i]; img; img = img->next) 1657 for (img = c->buckets[i]; img; img = img->next)
1657 if (img->hash == hash 1658 if (img->hash == hash
1658 && !NILP (Fequal (img->spec, spec)) 1659 && !NILP (Fequal (img->spec, spec))
1659 && (STRINGP (specified_bg) 1660 && img->frame_foreground == FRAME_FOREGROUND_PIXEL (f)
1660 || img->background == FRAME_BACKGROUND_PIXEL (f))) 1661 && img->frame_background == FRAME_BACKGROUND_PIXEL (f))
1661 break; 1662 break;
1662 return img; 1663 return img;
1663} 1664}
@@ -1929,6 +1930,8 @@ lookup_image (f, spec)
1929 img = make_image (spec, hash); 1930 img = make_image (spec, hash);
1930 cache_image (f, img); 1931 cache_image (f, img);
1931 img->load_failed_p = img->type->load (f, img) == 0; 1932 img->load_failed_p = img->type->load (f, img) == 0;
1933 img->frame_foreground = FRAME_FOREGROUND_PIXEL (f);
1934 img->frame_background = FRAME_BACKGROUND_PIXEL (f);
1932 1935
1933 /* If we can't load the image, and we don't have a width and 1936 /* If we can't load the image, and we don't have a width and
1934 height, use some arbitrary width and height so that we can 1937 height, use some arbitrary width and height so that we can