diff options
| author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2006-03-08 03:25:26 +0000 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2006-03-08 03:25:26 +0000 |
| commit | 4cdffedfae096a34769f29b455ecc3a78f13fa24 (patch) | |
| tree | ae721e733dbe430f0af2b203dd28bc87218702ee | |
| parent | 4299d849d878519b010c9a0638674673b2482538 (diff) | |
| download | emacs-4cdffedfae096a34769f29b455ecc3a78f13fa24.tar.gz | |
[MAC_OS] (XPutPixel): Set alpha channel bits if pixmap depth is 32.
[MAC_OS] (XGetPixel): Strip off alpha channel bits if pixmap depth is 32.
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/image.c | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1f27fc7a6f9..0bcf392c58c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2006-03-08 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * image.c [MAC_OS] (XPutPixel): Set alpha channel bits if pixmap + depth is 32. + [MAC_OS] (XGetPixel): Strip off alpha channel bits if pixmap + depth is 32. + 2006-03-06 Chong Yidong <cyd@stupidchicken.com> * xdisp.c (handle_invisible_prop): Don't update it->position with diff --git a/src/image.c b/src/image.c index 879bbf745a3..cbdff81eba7 100644 --- a/src/image.c +++ b/src/image.c @@ -194,7 +194,7 @@ XPutPixel (ximage, x, y, pixel) char *base_addr = GetPixBaseAddr (pixmap); short row_bytes = GetPixRowBytes (pixmap); - ((unsigned long *) (base_addr + y * row_bytes))[x] = pixel; + ((unsigned long *) (base_addr + y * row_bytes))[x] = 0xff000000 | pixel; } else if (depth == 1) { @@ -238,7 +238,7 @@ XGetPixel (ximage, x, y) char *base_addr = GetPixBaseAddr (pixmap); short row_bytes = GetPixRowBytes (pixmap); - return ((unsigned long *) (base_addr + y * row_bytes))[x]; + return ((unsigned long *) (base_addr + y * row_bytes))[x] & 0x00ffffff; } else if (depth == 1) { |
