Attachment "winrgb.454861.patch" to
ticket [454861ff]
added by
hobbs
2003-10-28 07:14:04.
? win/tkWinButton.c.grey
Index: win/tkWinImage.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/win/tkWinImage.c,v
retrieving revision 1.6.2.1
diff -u -u -r1.6.2.1 tkWinImage.c
--- win/tkWinImage.c 17 Jul 2003 01:02:47 -0000 1.6.2.1
+++ win/tkWinImage.c 28 Oct 2003 00:11:54 -0000
@@ -124,18 +124,19 @@
switch (image->bits_per_pixel) {
case 32:
/*
- * Pixel is DWORD: 0x00BBGGRR
+ * Pixel is DWORD: 0x00RRGGBB
*/
- destPtr[3] = 0;
+ (*(DWORD*)destPtr) = pixel;
+ break;
case 24:
/*
- * Pixel is triplet: 0xBBGGRR.
+ * Pixel is triplet: 0xRRGGBB.
*/
- destPtr[0] = (unsigned char) GetBValue(pixel);
- destPtr[1] = (unsigned char) GetGValue(pixel);
- destPtr[2] = (unsigned char) GetRValue(pixel);
+ destPtr[0] = (unsigned char) pixel;
+ destPtr[1] = (unsigned char) (((WORD)(pixel)) >> 8);
+ destPtr[2] = (unsigned char) ((pixel) >> 16);
break;
case 16:
/*
@@ -245,10 +246,10 @@
+ (bitmap_pad - 1)) >> 3) & ~((bitmap_pad >> 3) - 1);
}
- imagePtr->red_mask = 0;
- imagePtr->green_mask = 0;
- imagePtr->blue_mask = 0;
+ imagePtr->red_mask = visual->red_mask;
+ imagePtr->green_mask = visual->green_mask;
+ imagePtr->blue_mask = visual->blue_mask;
imagePtr->f.put_pixel = PutPixel;
imagePtr->f.get_pixel = ImageGetPixel;
Index: win/tkWinX.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/win/tkWinX.c,v
retrieving revision 1.25
diff -u -u -r1.25 tkWinX.c
--- win/tkWinX.c 8 Dec 2002 00:46:51 -0000 1.25
+++ win/tkWinX.c 28 Oct 2003 00:11:54 -0000
@@ -499,9 +499,9 @@
} else if (screen->root_depth >= 24) {
screen->root_visual->class = TrueColor;
screen->root_visual->map_entries = 256;
- screen->root_visual->red_mask = 0xff;
+ screen->root_visual->red_mask = 0xff0000;
screen->root_visual->green_mask = 0xff00;
- screen->root_visual->blue_mask = 0xff0000;
+ screen->root_visual->blue_mask = 0xff;
}
}
screen->root_visual->bits_per_rgb = screen->root_depth;