diff options
| author | Chong Yidong | 2009-02-06 17:19:10 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-02-06 17:19:10 +0000 |
| commit | 8d3c4e79fb7af9816300834842fb4a30e661211d (patch) | |
| tree | 8e98492d024f4b75c3008270b7205cda9ffea5f8 /src | |
| parent | eb306cab7d4ddff0e7279e5c5545125051cb1a3f (diff) | |
| download | emacs-8d3c4e79fb7af9816300834842fb4a30e661211d.tar.gz emacs-8d3c4e79fb7af9816300834842fb4a30e661211d.zip | |
(svg_load_image): Fix last change.
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/image.c b/src/image.c index a02f86a9c90..3323a68d33f 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -8079,17 +8079,8 @@ svg_load_image (f, img, contents, size) | |||
| 8079 | /* Handle alpha channel by combining the image with a background | 8079 | /* Handle alpha channel by combining the image with a background |
| 8080 | color. */ | 8080 | color. */ |
| 8081 | specified_bg = image_spec_value (img->spec, QCbackground, NULL); | 8081 | specified_bg = image_spec_value (img->spec, QCbackground, NULL); |
| 8082 | if (STRINGP (specified_bg) | 8082 | if (!STRINGP (specified_bg) |
| 8083 | && x_defined_color (f, SDATA (specified_bg), &background, 0)) | 8083 | || !x_defined_color (f, SDATA (specified_bg), &background, 0)) |
| 8084 | { | ||
| 8085 | /* SVG pixmaps specify transparency in the last byte, so right | ||
| 8086 | shift 8 bits to get rid of it, since emacs doesn't support | ||
| 8087 | transparency. */ | ||
| 8088 | background.red >>= 8; | ||
| 8089 | background.green >>= 8; | ||
| 8090 | background.blue >>= 8; | ||
| 8091 | } | ||
| 8092 | else | ||
| 8093 | { | 8084 | { |
| 8094 | #ifndef HAVE_NS | 8085 | #ifndef HAVE_NS |
| 8095 | background.pixel = FRAME_BACKGROUND_PIXEL (f); | 8086 | background.pixel = FRAME_BACKGROUND_PIXEL (f); |
| @@ -8099,6 +8090,13 @@ svg_load_image (f, img, contents, size) | |||
| 8099 | #endif | 8090 | #endif |
| 8100 | } | 8091 | } |
| 8101 | 8092 | ||
| 8093 | /* SVG pixmaps specify transparency in the last byte, so right | ||
| 8094 | shift 8 bits to get rid of it, since emacs doesn't support | ||
| 8095 | transparency. */ | ||
| 8096 | background.red >>= 8; | ||
| 8097 | background.green >>= 8; | ||
| 8098 | background.blue >>= 8; | ||
| 8099 | |||
| 8102 | /* This loop handles opacity values, since Emacs assumes | 8100 | /* This loop handles opacity values, since Emacs assumes |
| 8103 | non-transparent images. Each pixel must be "flattened" by | 8101 | non-transparent images. Each pixel must be "flattened" by |
| 8104 | calculating the resulting color, given the transparency of the | 8102 | calculating the resulting color, given the transparency of the |