summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkImgPhInstance.c1
-rw-r--r--macosx/tkMacOSXImage.c10
-rw-r--r--macosx/tkMacOSXXStubs.c1
-rw-r--r--xlib/X11/Xlib.h4
4 files changed, 9 insertions, 7 deletions
diff --git a/generic/tkImgPhInstance.c b/generic/tkImgPhInstance.c
index 0a5be7a..76c4a8a 100644
--- a/generic/tkImgPhInstance.c
+++ b/generic/tkImgPhInstance.c
@@ -631,7 +631,6 @@ TkImgPhotoDisplay(
(unsigned int)instancePtr->width,
(unsigned int)instancePtr->height,
0, (unsigned int)(4 * instancePtr->width));
-
TkPutImage(NULL, 0, display, drawable, instancePtr->gc,
photo, imageX, imageY, drawableX, drawableY,
(unsigned int) width, (unsigned int) height);
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;
diff --git a/xlib/X11/Xlib.h b/xlib/X11/Xlib.h
index b027e28..8d8ec68 100644
--- a/xlib/X11/Xlib.h
+++ b/xlib/X11/Xlib.h
@@ -203,9 +203,6 @@ typedef struct {
int class; /* class of screen (monochrome, etc.) */
#endif
unsigned long red_mask, green_mask, blue_mask; /* mask values */
-#if defined(MAC_OSX_TK)
- unsigned long alpha_mask;
-#endif
int bits_per_rgb; /* log base 2 of distinct color values */
int map_entries; /* color map entries */
} Visual;
@@ -335,7 +332,6 @@ typedef struct _XImage {
XPointer obdata; /* hook for the object routines to hang on */
#if defined(MAC_OSX_TK)
int pixelpower; /* n such that pixels are 2^n x 2^n blocks*/
- unsigned long alpha_mask;
#endif
struct funcs { /* image manipulation routines */
struct _XImage *(*create_image)();