From e0e9b6361641ae0c549442b852bb39463862999d Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 25 Nov 2023 15:20:40 +0000 Subject: Fix [fe942372aa]: Aqua: XPutImage() swaps red and blue channels. Patch from Christopher Chavez. --- macosx/tkMacOSXImage.c | 8 +++----- 1 file 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( -- cgit v0.12 From 4ba9a6d13a84325cf9f4644eba76651df846aeae Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 25 Nov 2023 15:51:53 +0000 Subject: Let this bugfix branch build and test at Github Actions for the macOS platform. --- .github/workflows/mac-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index 6c06a55..37b0a4c 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -4,6 +4,7 @@ on: branches: - "main" - "core-8-6-branch" + - "bug-fe942372aa" tags: - "core-**" permissions: -- cgit v0.12