summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXDraw.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2017-10-12 12:30:30 (GMT)
committerKevin Walzer <kw@codebykevin.com>2017-10-12 12:30:30 (GMT)
commitc2a813ae1dca8c52c8a436702e8e0b3c6d03a700 (patch)
treef3d7ea42577a9427824b0f6443b5759ee663acfd /macosx/tkMacOSXDraw.c
parent2b0ca907279d39d6a0110b491c98d0cb8201aeff (diff)
downloadtk-c2a813ae1dca8c52c8a436702e8e0b3c6d03a700.zip
tk-c2a813ae1dca8c52c8a436702e8e0b3c6d03a700.tar.gz
tk-c2a813ae1dca8c52c8a436702e8e0b3c6d03a700.tar.bz2
Fix for colorspace issues and regression in drawing on macOS; thanks to Marc Culler for patches
Diffstat (limited to 'macosx/tkMacOSXDraw.c')
-rw-r--r--macosx/tkMacOSXDraw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index 046c51d..80a4910 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -483,7 +483,7 @@ CreateCGImageWithXImage(
* Color image
*/
- CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
+ CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB();
bitsPerComponent = 8;
bitsPerPixel = 32;
@@ -685,7 +685,7 @@ GetCGContextForDrawable(
bitsPerPixel = 8;
bitmapInfo = (CGBitmapInfo)kCGImageAlphaOnly;
} else {
- colorspace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
+ colorspace = CGColorSpaceCreateDeviceRGB();
bitsPerPixel = 32;
bitmapInfo |= kCGImageAlphaPremultipliedFirst;
}