When a DC has the default palette selected, use the color value from PALETTERGB() directly instead of looking it up in the dc palette (just as the code was before). Fixes skipped bitmap winetests

svn path=/trunk/; revision=56440
This commit is contained in:
Timo Kreuzer 2012-04-27 17:18:30 +00:00
parent d926eda7ce
commit 4d93b7e8d5

View file

@ -41,12 +41,20 @@ TranslateCOLORREF(PDC pdc, COLORREF *pcrColor)
case 0x02: /* PALETTERGB */
/* First find the nearest index in the dc palette */
ppalDC = pdc->dclevel.ppal;
index = PALETTE_ulGetNearestIndex(ppalDC, crColor & 0xFFFFFF);
if (pdc->dclevel.hpal != StockObjects[DEFAULT_PALETTE])
{
/* First find the nearest index in the dc palette */
ppalDC = pdc->dclevel.ppal;
index = PALETTE_ulGetNearestIndex(ppalDC, crColor & 0xFFFFFF);
/* Get the RGB value */
crColor = PALETTE_ulGetRGBColorFromIndex(ppalDC, index);
/* Get the RGB value */
crColor = PALETTE_ulGetRGBColorFromIndex(ppalDC, index);
}
else
{
/* Use the pure color */
crColor = crColor & 0x00FFFFFF;
}
break;
case 0x10: /* DIBINDEX */