aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2007-08-07 16:25:26 +0000
committerChong Yidong2007-08-07 16:25:26 +0000
commit8198352bca8b704e80bead200a790e0bc616723b (patch)
tree446d0fb9214033ce233b5af4db7a621f8198cc8c /src
parent8a7e2b234935c9c7eabab2538e34ac1f56d15766 (diff)
downloademacs-8198352bca8b704e80bead200a790e0bc616723b.tar.gz
emacs-8198352bca8b704e80bead200a790e0bc616723b.zip
Minor cleanup.
Diffstat (limited to 'src')
-rw-r--r--src/image.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/image.c b/src/image.c
index fb0420045e2..a3cd3195217 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1644,6 +1644,8 @@ search_image_cache (f, spec, hash)
1644 struct image_cache *c = FRAME_X_IMAGE_CACHE (f); 1644 struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
1645 int i = hash % IMAGE_CACHE_BUCKETS_SIZE; 1645 int i = hash % IMAGE_CACHE_BUCKETS_SIZE;
1646 1646
1647 if (!c) return NULL;
1648
1647 /* If the image spec does not specify a background color, the cached 1649 /* If the image spec does not specify a background color, the cached
1648 image must have the same background color as the current frame. 1650 image must have the same background color as the current frame.
1649 The foreground color must also match, for the sake of monochrome 1651 The foreground color must also match, for the sake of monochrome
@@ -1655,13 +1657,10 @@ search_image_cache (f, spec, hash)
1655 for formats that don't use transparency (such as jpeg), or if the 1657 for formats that don't use transparency (such as jpeg), or if the
1656 image spec specifies :background. However, the extra memory 1658 image spec specifies :background. However, the extra memory
1657 usage is probably negligible in practice, so we don't bother. */ 1659 usage is probably negligible in practice, so we don't bother. */
1658 if (!c) return NULL;
1659 1660
1660 for (img = c->buckets[i]; img; img = img->next) 1661 for (img = c->buckets[i]; img; img = img->next)
1661 if (img->hash == hash 1662 if (img->hash == hash
1662 && !NILP (Fequal (img->spec, spec)) 1663 && !NILP (Fequal (img->spec, spec))
1663 /* If the image spec specifies a background, it doesn't matter
1664 what the frame background is. */
1665 && img->frame_foreground == FRAME_FOREGROUND_PIXEL (f) 1664 && img->frame_foreground == FRAME_FOREGROUND_PIXEL (f)
1666 && img->frame_background == FRAME_BACKGROUND_PIXEL (f)) 1665 && img->frame_background == FRAME_BACKGROUND_PIXEL (f))
1667 break; 1666 break;
@@ -6360,9 +6359,8 @@ png_load (f, img)
6360 } 6359 }
6361 } 6360 }
6362 /* The commented-out code checked if the png specifies a default 6361 /* The commented-out code checked if the png specifies a default
6363 background color, and uses that. Since we rely on the 6362 background color, and uses that. Since we use the current
6364 current frame background, it is actually OK for us to ignore 6363 frame background, it is OK for us to ignore this.
6365 this part.
6366 6364
6367 else if (fn_png_get_bKGD (png_ptr, info_ptr, &image_bg)) 6365 else if (fn_png_get_bKGD (png_ptr, info_ptr, &image_bg))
6368 fn_png_set_background (png_ptr, image_bg, 6366 fn_png_set_background (png_ptr, image_bg,