mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
[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. svn path=/trunk/; revision=50676
This commit is contained in:
parent
f0395ac74a
commit
f1debffcda
2 changed files with 15 additions and 3 deletions
|
@ -1750,9 +1750,19 @@ BuildDIBPalette(CONST BITMAPINFO *bmi)
|
||||||
else if (bmi->bmiHeader.biCompression == BI_BITFIELDS)
|
else if (bmi->bmiHeader.biCompression == BI_BITFIELDS)
|
||||||
{
|
{
|
||||||
paletteType = PAL_BITFIELDS;
|
paletteType = PAL_BITFIELDS;
|
||||||
RedMask = pdwColors[0];
|
if (bmi->bmiHeader.biSize >= sizeof(BITMAPV4HEADER))
|
||||||
GreenMask = pdwColors[1];
|
{
|
||||||
BlueMask = pdwColors[2];
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -197,6 +197,8 @@ PALETTE_AllocPalette(ULONG Mode,
|
||||||
PalGDI->flFlags |= PAL_RGB16_565;
|
PalGDI->flFlags |= PAL_RGB16_565;
|
||||||
else if (Red == 0xFF0000 && Green == 0xFF00 && Blue == 0xFF)
|
else if (Red == 0xFF0000 && Green == 0xFF00 && Blue == 0xFF)
|
||||||
PalGDI->flFlags |= PAL_BGR;
|
PalGDI->flFlags |= PAL_BGR;
|
||||||
|
else if (Red == 0xFF && Green == 0xFF00 && Blue == 0xFF0000)
|
||||||
|
PalGDI->flFlags |= PAL_RGB;
|
||||||
}
|
}
|
||||||
|
|
||||||
PALETTE_UnlockPalette(PalGDI);
|
PALETTE_UnlockPalette(PalGDI);
|
||||||
|
|
Loading…
Reference in a new issue