summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordas <das>2004-02-23 10:49:29 (GMT)
committerdas <das>2004-02-23 10:49:29 (GMT)
commit297090b448fe798845d0a7c7e9427e9ef7dbc8ca (patch)
treeb311d4d99e05537a622c27159bf7d6b0c74ef3a3 /generic
parent27f215c03a679ec897bd96a5fa2daa40fb42b7db (diff)
downloadtk-297090b448fe798845d0a7c7e9427e9ef7dbc8ca.zip
tk-297090b448fe798845d0a7c7e9427e9ef7dbc8ca.tar.gz
tk-297090b448fe798845d0a7c7e9427e9ef7dbc8ca.tar.bz2
* macosx/tkMacOSXDraw.c:
* macosx/tkMacOSXXStubs.c: * xlib/ximage.c: fixed MacOSX XGetImage/XPutImage and related functions to deal properly with XImages copied from screen. * generic/tkCanvPs.c (TkImageGetColor): MacOSX fix. * generic/tkImgPhoto.c (ImgPhotoDisplay): enabled alpha blending for images with partial transparency on MacOSX. [Bug 809157]
Diffstat (limited to 'generic')
-rw-r--r--generic/tkCanvPs.c14
-rw-r--r--generic/tkImgPhoto.c8
2 files changed, 14 insertions, 8 deletions
diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c
index e987b5d..667291b 100644
--- a/generic/tkCanvPs.c
+++ b/generic/tkCanvPs.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkCanvPs.c,v 1.13 2003/02/18 21:54:18 hobbs Exp $
+ * RCS: @(#) $Id: tkCanvPs.c,v 1.13.2.1 2004/02/23 10:49:29 das Exp $
*/
#include "tkInt.h"
@@ -1137,7 +1137,13 @@ GetPostscriptPoints(interp, string, doublePtr)
#define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8))
#define GetBValue(rgb) ((BYTE)((rgb)>>16))
*/
+#else
+#define GetRValue(rgb) ((rgb & cdata->red_mask) >> cdata->red_shift)
+#define GetGValue(rgb) ((rgb & cdata->green_mask) >> cdata->green_shift)
+#define GetBValue(rgb) ((rgb & cdata->blue_mask) >> cdata->blue_shift)
+#endif
+#if defined(WIN32) || defined(MAC_OSX_TK)
static void
TkImageGetColor(cdata, pixel, red, green, blue)
TkColormapData *cdata; /* Colormap data */
@@ -1156,9 +1162,9 @@ TkImageGetColor(cdata, pixel, red, green, blue)
double *red, *green, *blue; /* Color data to return */
{
if (cdata->separated) {
- int r = (pixel & cdata->red_mask) >> cdata->red_shift;
- int g = (pixel & cdata->green_mask) >> cdata->green_shift;
- int b = (pixel & cdata->blue_mask) >> cdata->blue_shift;
+ int r = GetRValue(pixel);
+ int g = GetGValue(pixel);
+ int b = GetBValue(pixel);
*red = cdata->colors[r].red / 65535.0;
*green = cdata->colors[g].green / 65535.0;
*blue = cdata->colors[b].blue / 65535.0;
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index d525660..edff9cf 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -17,7 +17,7 @@
* Department of Computer Science,
* Australian National University.
*
- * RCS: @(#) $Id: tkImgPhoto.c,v 1.36.2.4 2004/02/09 14:40:31 dkf Exp $
+ * RCS: @(#) $Id: tkImgPhoto.c,v 1.36.2.5 2004/02/23 10:49:30 das Exp $
*/
#include "tkInt.h"
@@ -2678,10 +2678,10 @@ ImgPhotoDisplay(clientData, display, drawable, imageX, imageY, width,
}
if (
-#if defined(MAC_TCL) || defined(MAC_OSX_TK)
+#if defined(MAC_TCL)
/*
- * The retrieval of bgImg is currently not functional on OSX
- * (and likely not OS9 either), so skip attempts to alpha blend.
+ * The retrieval of bgImg is currently not functional on OS9
+ * so skip attempts to alpha blend.
*/
0 &&
#endif