Author: tkreuzer
Date: Sat Feb 12 20:30:09 2011
New Revision: 50676
URL:
http://svn.reactos.org/svn/reactos?rev=50676&view=rev
Log:
[WIN32K]
Handle BITMAPV4HEADER and BITMAPV5HEADER, when creating a DIB palette. Detect PAL_RGB like
done with PAL_BGR in PALETTE_AllocPalette (optimization).
Fixes pink icons.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
trunk/reactos/subsystems/win32/win32k/objects/palette.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] Sat Feb 12
20:30:09 2011
@@ -1750,9 +1750,19 @@
else if (bmi->bmiHeader.biCompression == BI_BITFIELDS)
{
paletteType = PAL_BITFIELDS;
- RedMask = pdwColors[0];
- GreenMask = pdwColors[1];
- BlueMask = pdwColors[2];
+ if (bmi->bmiHeader.biSize >= sizeof(BITMAPV4HEADER))
+ {
+ PBITMAPV4HEADER pV4Header = (PBITMAPV4HEADER)&bmi->bmiHeader;
+ RedMask = pV4Header->bV4RedMask;
+ GreenMask = pV4Header->bV4GreenMask;
+ BlueMask = pV4Header->bV4BlueMask;
+ }
+ else
+ {
+ RedMask = pdwColors[0];
+ GreenMask = pdwColors[1];
+ BlueMask = pdwColors[2];
+ }
}
else
{
Modified: trunk/reactos/subsystems/win32/win32k/objects/palette.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/palette.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/palette.c [iso-8859-1] Sat Feb 12
20:30:09 2011
@@ -197,6 +197,8 @@
PalGDI->flFlags |= PAL_RGB16_565;
else if (Red == 0xFF0000 && Green == 0xFF00 && Blue == 0xFF)
PalGDI->flFlags |= PAL_BGR;
+ else if (Red == 0xFF && Green == 0xFF00 && Blue == 0xFF0000)
+ PalGDI->flFlags |= PAL_RGB;
}
PALETTE_UnlockPalette(PalGDI);