gdi32: Always set compression to BI_BITFIELDS for 16-bpp DIB sections.
This commit is contained in:
parent
cf4c565fd2
commit
c668354cc0
@ -1221,15 +1221,9 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage,
|
|||||||
dib->dsBmih.biClrUsed = 1 << info->bmiHeader.biBitCount;
|
dib->dsBmih.biClrUsed = 1 << info->bmiHeader.biBitCount;
|
||||||
|
|
||||||
/* set dsBitfields values */
|
/* set dsBitfields values */
|
||||||
dib->dsBitfields[0] = dib->dsBitfields[1] = dib->dsBitfields[2] = 0;
|
|
||||||
|
|
||||||
if (info->bmiHeader.biBitCount == 16 && info->bmiHeader.biCompression == BI_RGB)
|
if (info->bmiHeader.biBitCount == 16 && info->bmiHeader.biCompression == BI_RGB)
|
||||||
{
|
{
|
||||||
/* In this case Windows changes biCompression to BI_BITFIELDS,
|
dib->dsBmih.biCompression = 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->dsBitfields[0] = 0x7c00;
|
dib->dsBitfields[0] = 0x7c00;
|
||||||
dib->dsBitfields[1] = 0x03e0;
|
dib->dsBitfields[1] = 0x03e0;
|
||||||
dib->dsBitfields[2] = 0x001f;
|
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);
|
dib->dsBitfields[2] = *((const DWORD *)bmi->bmiColors + 2);
|
||||||
if (!dib->dsBitfields[0] || !dib->dsBitfields[1] || !dib->dsBitfields[2]) goto error;
|
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 */
|
/* 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[0] == 0x7c00, "got %08x\n", ds.dsBitfields[0]);
|
||||||
ok(ds.dsBitfields[1] == 0x03e0, "got %08x\n", ds.dsBitfields[1]);
|
ok(ds.dsBitfields[1] == 0x03e0, "got %08x\n", ds.dsBitfields[1]);
|
||||||
ok(ds.dsBitfields[2] == 0x001f, "got %08x\n", ds.dsBitfields[2]);
|
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);
|
ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %x\n", ds.dsBmih.biCompression);
|
||||||
|
|
||||||
orig_bm = SelectObject(mem_dc, dib);
|
orig_bm = SelectObject(mem_dc, dib);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user