diff options
author | fvogel <fvogelnew1@free.fr> | 2023-12-03 18:49:50 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2023-12-03 18:49:50 (GMT) |
commit | 2792d0f24ca56bf9191cb1d1f9934d306a4fc10e (patch) | |
tree | c3a458b94605630dc021e8abe43a2dc31e7ccb9c /macosx | |
parent | 937fadd644b99cfc16a86383ec03f03e83336778 (diff) | |
parent | c0764ea9cc2d2af68135605eda1a8214d0afa571 (diff) | |
download | tk-2792d0f24ca56bf9191cb1d1f9934d306a4fc10e.zip tk-2792d0f24ca56bf9191cb1d1f9934d306a4fc10e.tar.gz tk-2792d0f24ca56bf9191cb1d1f9934d306a4fc10e.tar.bz2 |
Fix [fe942372aa]: Aqua: XPutImage() swaps red and blue channels. Patch from Christopher Chavez.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXImage.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c index a30302a..5a79acd 100644 --- a/macosx/tkMacOSXImage.c +++ b/macosx/tkMacOSXImage.c @@ -121,13 +121,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; @@ -183,7 +182,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( |