Author: khornicek
Date: Wed Oct 26 10:21:46 2016
New Revision: 73038
URL:
http://svn.reactos.org/svn/reactos?rev=73038&view=rev
Log:
[WIN32K]
- fix a typo in the default logical palette copy
- fix color table computation for 8 bpp in GreGetDIBitsInternal (formula taken from
gdi32:bitmap winetest)
Modified:
trunk/reactos/win32ss/gdi/ntgdi/dibobj.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/dibobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dibobj.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] Wed Oct 26 10:21:46 2016
@@ -48,7 +48,7 @@
{ 0xf0, 0xfb, 0xff, 0x00 },
{ 0xa4, 0xa0, 0xa0, 0x00 },
{ 0x80, 0x80, 0x80, 0x00 },
- { 0x00, 0x00, 0xf0, 0x00 },
+ { 0x00, 0x00, 0xff, 0x00 },
{ 0x00, 0xff, 0x00, 0x00 },
{ 0x00, 0xff, 0xff, 0x00 },
{ 0xff, 0x00, 0x00, 0x00 },
@@ -794,8 +794,8 @@
case 8:
Info->bmiHeader.biClrUsed = 0;
- /* If the bitmap if a DIB section and has the same format than what
- * we're asked, go ahead! */
+ /* If the bitmap is a DIB section and has the same format as what
+ * is requested, go ahead! */
if((psurf->hSecure) &&
(BitsPerFormat(psurf->SurfObj.iBitmapFormat) == bpp))
{
@@ -863,26 +863,17 @@
case 8:
{
- INT r, g, b;
- RGBQUAD *color;
- memcpy(rgbQuads, DefLogPaletteQuads,
- 10 * sizeof(RGBQUAD));
- memcpy(rgbQuads + 246, DefLogPaletteQuads + 10,
- 10 * sizeof(RGBQUAD));
- color = rgbQuads + 10;
- for(r = 0; r <= 5; r++) /* FIXME */
+ INT i;
+
+ memcpy(rgbQuads, DefLogPaletteQuads, 10 * sizeof(RGBQUAD));
+ memcpy(rgbQuads + 246, DefLogPaletteQuads + 10, 10 *
sizeof(RGBQUAD));
+
+ for (i = 10; i < 246; i++)
{
- for(g = 0; g <= 5; g++)
- {
- for(b = 0; b <= 5; b++)
- {
- color->rgbRed = (r * 0xff) / 5;
- color->rgbGreen = (g * 0xff) / 5;
- color->rgbBlue = (b * 0xff) / 5;
- color->rgbReserved = 0;
- color++;
- }
- }
+ rgbQuads[i].rgbRed = (i & 0x07) << 5;
+ rgbQuads[i].rgbGreen = (i & 0x38) << 2;
+ rgbQuads[i].rgbBlue = i & 0xc0;
+ rgbQuads[i].rgbReserved = 0;
}
}
}