diff options
author | culler <culler> | 2018-11-10 00:45:34 (GMT) |
---|---|---|
committer | culler <culler> | 2018-11-10 00:45:34 (GMT) |
commit | bfc96895328c38d81ad657b7a5d620ad42e67796 (patch) | |
tree | f736d242a20785653552b95012f4ae51f9a5a4a3 /macosx | |
parent | edeaa03fec080516ed29f71138581e4310c5ec86 (diff) | |
download | tk-bfc96895328c38d81ad657b7a5d620ad42e67796.zip tk-bfc96895328c38d81ad657b7a5d620ad42e67796.tar.gz tk-bfc96895328c38d81ad657b7a5d620ad42e67796.tar.bz2 |
TkPutImage should not assume that a pixmap is transparent, even though it does have alpha=0.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXImage.c | 10 | ||||
-rw-r--r-- | macosx/tkMacOSXXStubs.c | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c index 2b747f1..22882d2 100644 --- a/macosx/tkMacOSXImage.c +++ b/macosx/tkMacOSXImage.c @@ -531,6 +531,7 @@ TkPutImage( unsigned int height) /* distination and source. */ { TkMacOSXDrawingContext dc; + MacDrawable *macDraw = (MacDrawable *) drawable; display->request++; if (!TkMacOSXSetupDrawingContext(drawable, gc, 1, &dc)) { @@ -539,7 +540,14 @@ TkPutImage( if (dc.context) { CGRect bounds, srcRect, dstRect; CGImageRef img = TkMacOSXCreateCGImageWithXImage(image); - CGContextSetBlendMode(dc.context, kCGBlendModeSourceAtop); + if (macDraw->flags & TK_IS_PIXMAP) { + /* + * The CGContext for a pixmap is RGB only, with A = 0. + */ + CGContextSetBlendMode(dc.context, kCGImageAlphaNoneSkipLast); + } else { + CGContextSetBlendMode(dc.context, kCGBlendModeSourceAtop); + } if (img) { /* If the XImage has big pixels, the source is rescaled to reflect diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index ee33537..cc98e84 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -203,7 +203,6 @@ TkpOpenDisplay( screen->root_visual = ckalloc(sizeof(Visual)); screen->root_visual->visualid = 0; screen->root_visual->class = TrueColor; - screen->root_visual->alpha_mask = 0xFF000000; screen->root_visual->red_mask = 0x00FF0000; screen->root_visual->green_mask = 0x0000FF00; screen->root_visual->blue_mask = 0x000000FF; |