Commit 60faf44e authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

win32u: Allow selecting 32-bit DDBs into display compatible DCs.

Device context bit depths other than 32-bit are emulated and the real bit depth for display DCs is still 32-bit. Thus, a 32-bit DDB should be allowed to be selected into a display compatible DC even if the DC reports a different bit depth. Fix a regression from d171d111. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51805Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent bd0603b1
......@@ -2301,7 +2301,6 @@ static void test_display_dc(void)
bpp = GetDeviceCaps(mem_dc, BITSPIXEL);
ok(bpp == dm2.dmBitsPerPel, "Expected bpp %d, got %d.\n", dm2.dmBitsPerPel, bpp);
old_hbitmap = SelectObject(mem_dc, hbitmap);
todo_wine
ok(!!old_hbitmap, "Failed to select bitmap.\n");
bpp = GetDeviceCaps(mem_dc, BITSPIXEL);
ok(bpp == dm2.dmBitsPerPel, "Expected bpp %d, got %d.\n", dm2.dmBitsPerPel, bpp);
......@@ -2329,7 +2328,6 @@ static void test_display_dc(void)
ok(!old_hbitmap || broken(!!old_hbitmap) /* Win7 dual-QXL test bot and XP */,
"Selecting bitmap succeeded.\n");
else
todo_wine_if(bpps[i] == 32)
ok(!!old_hbitmap || broken(!old_hbitmap) /* Win7 dual-QXL test bot and XP */,
"Failed to select bitmap.\n");
......
......@@ -401,7 +401,9 @@ HGDIOBJ WINAPI NtGdiSelectBitmap( HDC hdc, HGDIOBJ handle )
if (!is_bitmapobj_dib( bitmap ) &&
bitmap->dib.dsBm.bmBitsPixel != 1 &&
bitmap->dib.dsBm.bmBitsPixel != NtGdiGetDeviceCaps( hdc, BITSPIXEL ))
bitmap->dib.dsBm.bmBitsPixel != NtGdiGetDeviceCaps( hdc, BITSPIXEL ) &&
/* Display compatible DCs should accept 32-bit DDBs because other color depths are emulated */
!(NtGdiGetDeviceCaps( hdc, TECHNOLOGY ) == DT_RASDISPLAY && bitmap->dib.dsBm.bmBitsPixel == 32))
{
WARN( "Wrong format bitmap %u bpp\n", bitmap->dib.dsBm.bmBitsPixel );
GDI_ReleaseObj( handle );
......
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