diff options
Diffstat (limited to 'src/image.c')
| -rw-r--r-- | src/image.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/image.c b/src/image.c index 10b067f889c..79bf21e8865 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -1108,10 +1108,7 @@ get_spec_bg_or_alpha_as_argb (struct image *img, | |||
| 1108 | XColor xbgcolor; | 1108 | XColor xbgcolor; |
| 1109 | Lisp_Object bg = image_spec_value (img->spec, QCbackground, NULL); | 1109 | Lisp_Object bg = image_spec_value (img->spec, QCbackground, NULL); |
| 1110 | 1110 | ||
| 1111 | if (STRINGP (bg) && XParseColor (FRAME_X_DISPLAY (f), | 1111 | if (STRINGP (bg) && x_parse_color (f, SSDATA (bg), &xbgcolor)) |
| 1112 | FRAME_X_COLORMAP (f), | ||
| 1113 | SSDATA (bg), | ||
| 1114 | &xbgcolor)) | ||
| 1115 | bgcolor = xcolor_to_argb32 (xbgcolor); | 1112 | bgcolor = xcolor_to_argb32 (xbgcolor); |
| 1116 | 1113 | ||
| 1117 | return bgcolor; | 1114 | return bgcolor; |
| @@ -3241,7 +3238,10 @@ static struct xpm_cached_color *xpm_cache_color (struct frame *, char *, | |||
| 3241 | /* An entry in a hash table used to cache color definitions of named | 3238 | /* An entry in a hash table used to cache color definitions of named |
| 3242 | colors. This cache is necessary to speed up XPM image loading in | 3239 | colors. This cache is necessary to speed up XPM image loading in |
| 3243 | case we do color allocations ourselves. Without it, we would need | 3240 | case we do color allocations ourselves. Without it, we would need |
| 3244 | a call to XParseColor per pixel in the image. */ | 3241 | a call to XParseColor per pixel in the image. |
| 3242 | |||
| 3243 | FIXME Now that we're using x_parse_color and its cache, reevaluate | ||
| 3244 | the need for this caching layer. */ | ||
| 3245 | 3245 | ||
| 3246 | struct xpm_cached_color | 3246 | struct xpm_cached_color |
| 3247 | { | 3247 | { |
| @@ -3276,8 +3276,7 @@ xpm_init_color_cache (struct frame *f, XpmAttributes *attrs) | |||
| 3276 | XColor color; | 3276 | XColor color; |
| 3277 | 3277 | ||
| 3278 | for (i = 0; i < attrs->numsymbols; ++i) | 3278 | for (i = 0; i < attrs->numsymbols; ++i) |
| 3279 | if (XParseColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), | 3279 | if (x_parse_color (f, attrs->colorsymbols[i].value, &color)) |
| 3280 | attrs->colorsymbols[i].value, &color)) | ||
| 3281 | { | 3280 | { |
| 3282 | color.pixel = lookup_rgb_color (f, color.red, color.green, | 3281 | color.pixel = lookup_rgb_color (f, color.red, color.green, |
| 3283 | color.blue); | 3282 | color.blue); |
| @@ -3356,8 +3355,7 @@ xpm_lookup_color (struct frame *f, char *color_name, XColor *color) | |||
| 3356 | 3355 | ||
| 3357 | if (p != NULL) | 3356 | if (p != NULL) |
| 3358 | *color = p->color; | 3357 | *color = p->color; |
| 3359 | else if (XParseColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), | 3358 | else if (x_parse_color (f, color_name, color)) |
| 3360 | color_name, color)) | ||
| 3361 | { | 3359 | { |
| 3362 | color->pixel = lookup_rgb_color (f, color->red, color->green, | 3360 | color->pixel = lookup_rgb_color (f, color->red, color->green, |
| 3363 | color->blue); | 3361 | color->blue); |