summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-11-23 15:26:15 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-11-23 15:26:15 (GMT)
commitb7fdd1e846050be4e23fa920bf275653f0ad2829 (patch)
treea5b823d1b3bfe1ee967fae23bbb18b817e0b5f85 /macosx
parenta2594721f110178369e5c0cb5d981c4678a10708 (diff)
parentca27387956e16b5983011ccf2205e9e1229a03a6 (diff)
downloadtk-b7fdd1e846050be4e23fa920bf275653f0ad2829.zip
tk-b7fdd1e846050be4e23fa920bf275653f0ad2829.tar.gz
tk-b7fdd1e846050be4e23fa920bf275653f0ad2829.tar.bz2
Merge 8.6
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXDraw.c13
-rw-r--r--macosx/tkMacOSXSubwindows.c5
2 files changed, 2 insertions, 16 deletions
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index dea8588..2aaf4ba 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -248,7 +248,6 @@ Tk_MacOSXGetCGContextForDrawable(
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 @@ Tk_MacOSXGetCGContextForDrawable(
#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 = (size_t)(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 64cb35a..ed44ef5 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -1478,11 +1478,6 @@ Tk_FreePixmap(
LastKnownRequestProcessed(display)++;
if (macPix->context) {
- char *data = (char *)CGBitmapContextGetData(macPix->context);
-
- if (data) {
- ckfree(data);
- }
CFRelease(macPix->context);
}
ckfree(macPix);