Commit 05917020 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 11fb78d9
......@@ -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;
}
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment