Commit d171d111 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

gdi32: Return correct color depth for display DCs in GetDeviceCaps().

parent d8e6d2e3
......@@ -460,7 +460,24 @@ static INT CDECL nulldrv_GetDeviceCaps( PHYSDEV dev, INT cap )
return pGetSystemMetrics ? pGetSystemMetrics( SM_CYSCREEN ) : 480;
}
case BITSPIXEL: return 32;
case BITSPIXEL:
{
DEVMODEW devmode;
WCHAR *display;
DC *dc;
if (GetDeviceCaps( dev->hdc, TECHNOLOGY ) == DT_RASDISPLAY && pEnumDisplaySettingsW)
{
dc = get_nulldrv_dc( dev );
display = dc->display[0] ? dc->display : NULL;
memset( &devmode, 0, sizeof(devmode) );
devmode.dmSize = sizeof(devmode);
if (pEnumDisplaySettingsW( display, ENUM_CURRENT_SETTINGS, &devmode )
&& devmode.dmFields & DM_BITSPERPEL && devmode.dmBitsPerPel)
return devmode.dmBitsPerPel;
}
return 32;
}
case PLANES: return 1;
case NUMBRUSHES: return -1;
case NUMPENS: return -1;
......
......@@ -2068,7 +2068,6 @@ static void _check_display_dc(INT line, HDC hdc, const DEVMODEA *dm, BOOL allow_
dm->dmDisplayFrequency, value);
value = GetDeviceCaps(hdc, BITSPIXEL);
todo_wine_if(dm->dmBitsPerPel != 32)
ok_(__FILE__, line)(value == dm->dmBitsPerPel, "Expected BITSPIXEL %d, got %d.\n",
dm->dmBitsPerPel, value);
......
......@@ -162,8 +162,6 @@ static INT CDECL X11DRV_GetDeviceCaps( PHYSDEV dev, INT cap )
{
switch(cap)
{
case BITSPIXEL:
return screen_bpp;
case SIZEPALETTE:
return palette_size;
default:
......
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