From 586405c2627a8cd694f85b4fc7dc45d01d812e34 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 21 Nov 2023 22:11:11 +0000 Subject: Fix [22a4ad2a6e]: Aqua: let Core Graphics manage pixmap data memory. Patch from Christopher Chavez. --- macosx/tkMacOSXDraw.c | 13 ++----------- macosx/tkMacOSXSubwindows.c | 5 ----- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index f8c6ff9..7092611 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -248,7 +248,6 @@ TkMacOSXGetCGContextForDrawable( if (macDraw && (macDraw->flags & TK_IS_PIXMAP) && !macDraw->context) { const size_t bitsPerComponent = 8; - size_t bitsPerPixel, bytesPerRow, len; CGColorSpaceRef colorspace = NULL; CGBitmapInfo bitmapInfo = #ifdef __LITTLE_ENDIAN__ @@ -256,25 +255,17 @@ TkMacOSXGetCGContextForDrawable( #else kCGBitmapByteOrderDefault; #endif - char *data; CGRect bounds = CGRectMake(0, 0, macDraw->size.width, macDraw->size.height); if (macDraw->flags & TK_IS_BW_PIXMAP) { - bitsPerPixel = 8; bitmapInfo = (CGBitmapInfo)kCGImageAlphaOnly; } else { colorspace = CGColorSpaceCreateDeviceRGB(); - bitsPerPixel = 32; bitmapInfo |= kCGImageAlphaPremultipliedFirst; } - bytesPerRow = ((size_t) - macDraw->size.width * bitsPerPixel + 127) >> 3 & ~15; - len = macDraw->size.height * bytesPerRow; - data = (char *)ckalloc(len); - bzero(data, len); - macDraw->context = CGBitmapContextCreate(data, (unsigned)macDraw->size.width, - (unsigned)macDraw->size.height, bitsPerComponent, bytesPerRow, + macDraw->context = CGBitmapContextCreate(NULL, (unsigned)macDraw->size.width, + (unsigned)macDraw->size.height, bitsPerComponent, 0, colorspace, bitmapInfo); if (macDraw->context) { CGContextClearRect(macDraw->context, bounds); diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 1563c90..c950877 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -1510,11 +1510,6 @@ Tk_FreePixmap( LastKnownRequestProcessed(display)++; if (macPix->context) { - char *data = (char *)CGBitmapContextGetData(macPix->context); - - if (data) { - ckfree(data); - } CFRelease(macPix->context); } ckfree(macPix); -- cgit v0.12 From b43edc97a9e901b28046b09f852614083c4474dc Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 21 Nov 2023 22:19:45 +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..06e624c 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-22a4ad2a6e" tags: - "core-**" permissions: -- cgit v0.12 From ca27387956e16b5983011ccf2205e9e1229a03a6 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 23 Nov 2023 15:21:32 +0000 Subject: Fix [https://core.tcl-lang.org/tcl/info/e653408972|e653408972]: autoconf warning --- unix/configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/configure.in b/unix/configure.in index 474b7ed..6d03bbf 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -144,7 +144,7 @@ SC_TCL_64BIT_FLAGS # Check endianness because we can optimize some operations #-------------------------------------------------------------------- -AC_C_BIGENDIAN +AC_C_BIGENDIAN(,,,[#]) #------------------------------------------------------------------------ # If Tcl and Tk are installed in different places, adjust the library -- cgit v0.12