mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +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)
|
||||
{
|
||||
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
|
||||
{
|
||||
|
|
|
@ -197,6 +197,8 @@ PALETTE_AllocPalette(ULONG Mode,
|
|||
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);
|
||||
|
|
Loading…
Reference in a new issue