summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2023-11-25 15:20:40 (GMT)
committerfvogel <fvogelnew1@free.fr>2023-11-25 15:20:40 (GMT)
commite0e9b6361641ae0c549442b852bb39463862999d (patch)
tree4993df6d510f953cf507d91438bd161d3ae46bc4 /macosx
parent48ab1488e7104ed9f9b90435951cf56e4ad3d2ed (diff)
downloadtk-e0e9b6361641ae0c549442b852bb39463862999d.zip
tk-e0e9b6361641ae0c549442b852bb39463862999d.tar.gz
tk-e0e9b6361641ae0c549442b852bb39463862999d.tar.bz2
Fix [fe942372aa]: Aqua: XPutImage() swaps red and blue channels. Patch from Christopher Chavez.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXImage.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c
index 32f3db9..55cb99e 100644
--- a/macosx/tkMacOSXImage.c
+++ b/macosx/tkMacOSXImage.c
@@ -122,13 +122,12 @@ static void ReleaseData(
static CGImageRef
TkMacOSXCreateCGImageWithXImage(
XImage *image,
- uint32_t alphaInfo)
+ uint32_t bitmapInfo)
{
CGImageRef img = NULL;
size_t bitsPerComponent, bitsPerPixel;
size_t len = image->bytes_per_line * image->height;
const CGFloat *decode = NULL;
- CGBitmapInfo bitmapInfo;
CGDataProviderRef provider = NULL;
char *data = NULL;
CGDataProviderReleaseDataCallback releaseData = ReleaseData;
@@ -184,7 +183,6 @@ TkMacOSXCreateCGImageWithXImage(
CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
bitsPerComponent = 8;
bitsPerPixel = 32;
- bitmapInfo = kCGBitmapByteOrder32Big | alphaInfo;
data = (char *)ckalloc(len);
if (data) {
memcpy(data, image->data + image->xoffset, len);
@@ -483,8 +481,8 @@ XCreateImage(
*----------------------------------------------------------------------
*/
-#define USE_ALPHA kCGImageAlphaLast
-#define IGNORE_ALPHA kCGImageAlphaNoneSkipLast
+#define USE_ALPHA (kCGImageAlphaLast | kCGBitmapByteOrder32Big)
+#define IGNORE_ALPHA (kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little)
static int
TkMacOSXPutImage(