Commit 8da83349 authored by Michael Karcher's avatar Michael Karcher Committed by Alexandre Julliard

winex11: Fix GetDIBits of 1 bit DDBs.

1 bpp DDBs seem to always carry an implicit palette of black and white, regardless of what the DC says. Based on a patch from Eric Pouech.
parent fd8746b4
......@@ -1190,10 +1190,7 @@ static void test_GetDIBits_selected_DIB(UINT bpp)
break;
}
}
if (bpp != 1)
ok(equalContents, "GetDIBits with %d bpp DIB selected in DC: Invalid DIB bits\n",bpp);
else
todo_wine ok(equalContents, "GetDIBits with %d bpp DIB selected in DC: Invalid DIB bits\n",bpp);
ok(equalContents, "GetDIBits with %d bpp DIB selected in DC: Invalid DIB bits\n",bpp);
HeapFree(GetProcessHeap(), 0, bits2);
DeleteDC(dc);
......
......@@ -4031,13 +4031,24 @@ INT X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan,
int bitmap_type;
BOOL core_header;
void* colorPtr;
GetPaletteEntries( GetCurrentObject( physDev->hdc, OBJ_PAL ), 0, 256, palette );
const PALETTEENTRY peBlack = {0,0,0,0};
const PALETTEENTRY peWhite = {255,255,255,0};
if (!physBitmap) return 0;
if (!(obj_size = GetObjectW( hbitmap, sizeof(dib), &dib ))) return 0;
bitmap_type = DIB_GetBitmapInfo( (BITMAPINFOHEADER*)info, &width, &tempHeight, &descr.infoBpp, &descr.compression);
if (physDev->depth > 1)
{
GetPaletteEntries( GetCurrentObject( physDev->hdc, OBJ_PAL ), 0, 256, palette );
}
else
{
palette[0] = peBlack;
palette[1] = peWhite;
}
if (bitmap_type == -1)
{
ERR("Invalid bitmap\n");
......
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