diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index 0964f0df789..eb6c09d35f1 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -1638,11 +1638,7 @@ static void test_select_object(void) ok(hbm_old != 0, "SelectObject failed, BITSPIXEL: %d, created depth: %d\n", bpp, depths[i]); SelectObject(hdc, hbm_old); } else { - if(bpp == 24 && depths[i] == 32) { - todo_wine ok(hbm_old == 0, "SelectObject should fail. BITSPIXELS: %d, created depth: %d\n", bpp, depths[i]); - } else { - ok(hbm_old == 0, "SelectObject should fail. BITSPIXELS: %d, created depth: %d\n", bpp, depths[i]); - } + ok(hbm_old == 0, "SelectObject should fail. BITSPIXELS: %d, created depth: %d\n", bpp, depths[i]); } memset(&bm, 0xAA, sizeof(bm)); diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index 9e4e6b2d69b..b554430e416 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -2223,9 +2223,7 @@ static void test_WM_DISPLAYCHANGE(void) continue; } - if((start_bpp != test_bpps[i] || - (test_bpps[i] == 32 && last_bpp == 24)) && - !(test_bpps[i] == 24 && start_bpp == 32)) { + if(start_bpp != test_bpps[i]) { todo_wine ok(last_bpp == test_bpps[i], "Set bpp %d, but WM_DISPLAYCHANGE reported bpp %d\n", test_bpps[i], last_bpp); } else { ok(last_bpp == test_bpps[i], "Set bpp %d, but WM_DISPLAYCHANGE reported bpp %d\n", test_bpps[i], last_bpp); @@ -2533,13 +2531,8 @@ static void test_EnumDisplaySettings(void) hdc = GetDC(0); val = GetDeviceCaps(hdc, BITSPIXEL); - if(devmode.dmBitsPerPel == 32 && val == 24) { - todo_wine ok(devmode.dmBitsPerPel == val, "GetDeviceCaps(BITSPIXEL) returned %d, EnumDisplaySettings returned %d\n", - val, devmode.dmBitsPerPel); - } else { - ok(devmode.dmBitsPerPel == val, "GetDeviceCaps(BITSPIXEL) returned %d, EnumDisplaySettings returned %d\n", - val, devmode.dmBitsPerPel); - } + ok(devmode.dmBitsPerPel == val, "GetDeviceCaps(BITSPIXEL) returned %d, EnumDisplaySettings returned %d\n", + val, devmode.dmBitsPerPel); val = GetDeviceCaps(hdc, NUMCOLORS); if(devmode.dmBitsPerPel <= 8) { diff --git a/dlls/winex11.drv/bitmap.c b/dlls/winex11.drv/bitmap.c index b52b05da206..fffcab1727f 100644 --- a/dlls/winex11.drv/bitmap.c +++ b/dlls/winex11.drv/bitmap.c @@ -124,8 +124,6 @@ BOOL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, LPVOID bmBit /* check if bpp is compatible with screen depth */ if (!((bitmap.bmBitsPixel == 1) || (bitmap.bmBitsPixel == screen_bpp) || - (bitmap.bmBitsPixel == 24 && screen_bpp == 32) || /* FIXME: Not compatible */ - (bitmap.bmBitsPixel == 32 && screen_bpp == 24) || /* FIXME: Not compatible */ (bitmap.bmBitsPixel == 16 && screen_bpp == 15))) /* TODO: Confirm this */ { ERR("Trying to make bitmap with planes=%d, bpp=%d\n", diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 188cb1eb51b..1e189c85da3 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -104,7 +104,6 @@ static int X11DRV_desktop_GetCurrentMode(void) { unsigned int i; DWORD dwBpp = screen_bpp; - if (dwBpp == 24) dwBpp = 32; for (i=0; idwWidth = width; info->dwHeight = height; @@ -115,7 +118,7 @@ void X11DRV_Settings_AddDepthModes(void) int i, j; int existing_modes = dd_mode_count; DWORD dwBpp = screen_bpp; - if (dwBpp == 24) dwBpp = 32; + const DWORD *depths = screen_bpp == 32 ? depths_32 : depths_24; for (j=0; j<3; j++) { @@ -360,7 +363,7 @@ LONG X11DRV_ChangeDisplaySettingsEx( LPCWSTR devname, LPDEVMODEW devmode, devmode->dmPelsWidth,devmode->dmPelsHeight, devmode->dmBitsPerPel,devmode->dmDisplayFrequency, handler_name); - dwBpp = (devmode->dmBitsPerPel == 24) ? 32 : devmode->dmBitsPerPel; + dwBpp = devmode->dmBitsPerPel; if (devmode->dmFields & DM_BITSPERPEL) def_mode &= !dwBpp; if (devmode->dmFields & DM_PELSWIDTH) def_mode &= !devmode->dmPelsWidth; if (devmode->dmFields & DM_PELSHEIGHT) def_mode &= !devmode->dmPelsHeight; diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 5912a4ae31c..11cd33a7e16 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -492,7 +492,37 @@ static BOOL process_attach(void) XFree(desktop_vi); } - screen_bpp = screen_depth; /* TODO */ + switch(screen_depth) { + case 8: + screen_bpp = 8; + break; + + case 15: + /* Out tests suggest that windows does not support 15 bpp color depth. + * X11 does, what should we do with these situations? + */ + FIXME("The X server is running at 15 bpp color depth\n"); + screen_bpp = 15; + break; + + case 16: + screen_bpp = 16; + break; + + case 24: + /* This is not necessarily right. X11 always has 24 bits per pixel, but it can run + * with 24 bit framebuffers and 32 bit framebuffers. It doesn't make any difference + * for windowing, but gl applications can get visuals with alpha channels. So we + * should check the framebuffer and/or opengl formats available to find out what the + * framebuffer actually does + */ + screen_bpp = 32; + break; + + default: + FIXME("Unexpected X11 depth %d bpp, what to report to app?\n", screen_depth); + screen_bpp = screen_depth; + } XInternAtoms( display, (char **)atom_names, NB_XATOMS - FIRST_XATOM, False, X11DRV_Atoms ); diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index f2a5229f487..ad2dc0886e4 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -179,7 +179,6 @@ static LONG X11DRV_XRandR_SetCurrentMode(int mode) unsigned int i; int j; DWORD dwBpp = screen_bpp; - if (dwBpp == 24) dwBpp = 32; wine_tsx11_lock(); root = RootWindow (gdi_display, DefaultScreen(gdi_display)); diff --git a/dlls/winex11.drv/xvidmode.c b/dlls/winex11.drv/xvidmode.c index 6b675948c23..49c48b3f85c 100644 --- a/dlls/winex11.drv/xvidmode.c +++ b/dlls/winex11.drv/xvidmode.c @@ -95,7 +95,6 @@ static int X11DRV_XF86VM_GetCurrentMode(void) unsigned int i; DDHALMODEINFO cmode; DWORD dwBpp = screen_bpp; - if (dwBpp == 24) dwBpp = 32; TRACE("Querying XVidMode current mode\n"); wine_tsx11_lock(); @@ -114,7 +113,6 @@ static int X11DRV_XF86VM_GetCurrentMode(void) static LONG X11DRV_XF86VM_SetCurrentMode(int mode) { DWORD dwBpp = screen_bpp; - if (dwBpp == 24) dwBpp = 32; /* only set modes from the original color depth */ if (dwBpp != dd_modes[mode].dwBPP) {