gdi32: Map the black and white entries to the DIB color table after dithering.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-03-09 12:30:20 +01:00
parent 11fb78d9bd
commit 059170208a
2 changed files with 11 additions and 7 deletions

View File

@ -2141,12 +2141,16 @@ static DWORD rgb_to_pixel_mono(const dib_info *dib, BOOL dither, int x, int y,
{
DWORD ret;
if (dither)
ret = ((30 * r + 59 * g + 11 * b) / 100 + bayer_16x16[y % 16][x % 16]) > 255;
else if (dib->color_table_size == 1)
ret = (src_pixel == bg_pixel);
else
if (dib->color_table_size != 1)
{
if (dither)
{
if (((30 * r + 59 * g + 11 * b) / 100 + bayer_16x16[y % 16][x % 16]) > 255) r = g = b = 255;
else r = g = b = 0;
}
ret = rgb_to_pixel_colortable( dib, r, g, b );
}
else ret = (src_pixel == bg_pixel); /* only match raw pixel value */
return ret ? 0xff : 0;
}

View File

@ -1880,7 +1880,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits)
if (bmi->bmiHeader.biBitCount == 8 && bmi->bmiHeader.biClrUsed == 256) /* 8-bpp grayscale broken on NT4 */
compare_hash_broken_todo(hdc, bmi, bits, "bottom-up 8888 dib brush patblt", 1, FALSE);
else
compare_hash_broken_todo(hdc, bmi, bits, "bottom-up 8888 dib brush patblt", dib_is_1bpp ? 2 : 0, dib_is_1bpp);
compare_hash_broken_todo(hdc, bmi, bits, "bottom-up 8888 dib brush patblt", dib_is_1bpp ? 2 : 0, FALSE);
SelectObject(hdc, orig_brush);
DeleteObject(dib_brush);
@ -1910,7 +1910,7 @@ static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits)
if (bmi->bmiHeader.biBitCount == 8 && bmi->bmiHeader.biClrUsed == 256) /* 8-bpp grayscale broken on NT4 */
compare_hash_broken_todo(hdc, bmi, bits, "top-down 24 bpp brush patblt", 1, FALSE);
else
compare_hash_broken_todo(hdc, bmi, bits, "top-down 24 bpp brush patblt", dib_is_1bpp ? 2 : 0, dib_is_1bpp);
compare_hash_broken_todo(hdc, bmi, bits, "top-down 24 bpp brush patblt", dib_is_1bpp ? 2 : 0, FALSE);
SelectObject(hdc, orig_brush);
DeleteObject(dib_brush);