Commit c668354c authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Always set compression to BI_BITFIELDS for 16-bpp DIB sections.

parent cf4c565f
......@@ -1221,15 +1221,9 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage,
dib->dsBmih.biClrUsed = 1 << info->bmiHeader.biBitCount;
/* set dsBitfields values */
dib->dsBitfields[0] = dib->dsBitfields[1] = dib->dsBitfields[2] = 0;
if (info->bmiHeader.biBitCount == 16 && info->bmiHeader.biCompression == BI_RGB)
{
/* In this case Windows changes biCompression to BI_BITFIELDS,
however for now we won't do this, as there are a lot
of places where BI_BITFIELDS is currently unsupported. */
/* dib->dsBmih.biCompression = compression = BI_BITFIELDS;*/
dib->dsBmih.biCompression = BI_BITFIELDS;
dib->dsBitfields[0] = 0x7c00;
dib->dsBitfields[1] = 0x03e0;
dib->dsBitfields[2] = 0x001f;
......@@ -1241,6 +1235,7 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage,
dib->dsBitfields[2] = *((const DWORD *)bmi->bmiColors + 2);
if (!dib->dsBitfields[0] || !dib->dsBitfields[1] || !dib->dsBitfields[2]) goto error;
}
else dib->dsBitfields[0] = dib->dsBitfields[1] = dib->dsBitfields[2] = 0;
/* get storage location for DIB bits */
......
......@@ -1125,7 +1125,6 @@ static void test_simple_graphics(void)
ok(ds.dsBitfields[0] == 0x7c00, "got %08x\n", ds.dsBitfields[0]);
ok(ds.dsBitfields[1] == 0x03e0, "got %08x\n", ds.dsBitfields[1]);
ok(ds.dsBitfields[2] == 0x001f, "got %08x\n", ds.dsBitfields[2]);
todo_wine
ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %x\n", ds.dsBmih.biCompression);
orig_bm = SelectObject(mem_dc, dib);
......
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