gdi32: Fix palette of 1bpp DIB in GetDIBits.
Windows always generates a black/white palette for 1 bit DIBs generated from DDBs. Copying from the current palette only takes place for color DDBs (not explicitly mentioned in MSDN), and only if depth equal (MSDN states it, explicitly).
This commit is contained in:
parent
3f64708818
commit
fd8746b43c
|
@ -705,8 +705,10 @@ INT WINAPI GetDIBits(
|
||||||
for (i = 0; i < (1 << bpp); i++)
|
for (i = 0; i < (1 << bpp); i++)
|
||||||
((WORD *)colorPtr)[i] = (WORD)i;
|
((WORD *)colorPtr)[i] = (WORD)i;
|
||||||
}
|
}
|
||||||
else if(bpp >= bmp->bitmap.bmBitsPixel) {
|
else if(bpp > 1 && bpp == bmp->bitmap.bmBitsPixel) {
|
||||||
/* Generate the color map from the selected palette */
|
/* For color DDBs in native depth (mono DDBs always have
|
||||||
|
a black/white palette):
|
||||||
|
Generate the color map from the selected palette */
|
||||||
PALETTEENTRY palEntry[256];
|
PALETTEENTRY palEntry[256];
|
||||||
|
|
||||||
memset( palEntry, 0, sizeof(palEntry) );
|
memset( palEntry, 0, sizeof(palEntry) );
|
||||||
|
|
|
@ -1499,7 +1499,6 @@ static void test_GetDIBits(void)
|
||||||
"expected bmiColors[0] 0,0,0,0 - got %x %x %x %x\n",
|
"expected bmiColors[0] 0,0,0,0 - got %x %x %x %x\n",
|
||||||
bi->bmiColors[0].rgbRed, bi->bmiColors[0].rgbGreen,
|
bi->bmiColors[0].rgbRed, bi->bmiColors[0].rgbGreen,
|
||||||
bi->bmiColors[0].rgbBlue, bi->bmiColors[0].rgbReserved);
|
bi->bmiColors[0].rgbBlue, bi->bmiColors[0].rgbReserved);
|
||||||
todo_wine
|
|
||||||
ok(bi->bmiColors[1].rgbRed == 0xff && bi->bmiColors[1].rgbGreen == 0xff &&
|
ok(bi->bmiColors[1].rgbRed == 0xff && bi->bmiColors[1].rgbGreen == 0xff &&
|
||||||
bi->bmiColors[1].rgbBlue == 0xff && bi->bmiColors[1].rgbReserved == 0,
|
bi->bmiColors[1].rgbBlue == 0xff && bi->bmiColors[1].rgbReserved == 0,
|
||||||
"expected bmiColors[0] 0xff,0xff,0xff,0 - got %x %x %x %x\n",
|
"expected bmiColors[0] 0xff,0xff,0xff,0 - got %x %x %x %x\n",
|
||||||
|
|
Loading…
Reference in New Issue