NtGdiCreateDIBSection will allocate a color table for 8bpp bitmap anyway and if biClrUsed isn't set, we will later fail any color lookup.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57584
-- v4: winex11: Always fill the window surface color info. win32u: Initialize dibdrv info from the surface color bitmap.
From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57584 --- dlls/win32u/dibdrv/dc.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/dlls/win32u/dibdrv/dc.c b/dlls/win32u/dibdrv/dc.c index 2fc9000025d..60cd41142b2 100644 --- a/dlls/win32u/dibdrv/dc.c +++ b/dlls/win32u/dibdrv/dc.c @@ -790,12 +790,10 @@ static void unlock_windrv_bits( struct gdi_image_bits *bits )
void dibdrv_set_window_surface( DC *dc, struct window_surface *surface ) { - char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; - BITMAPINFO *info = (BITMAPINFO *)buffer; - void *bits; PHYSDEV windev; struct windrv_physdev *physdev; struct dibdrv_physdev *dibdrv; + BITMAPOBJ *bmp;
TRACE( "%p %p\n", dc->hSelf, surface );
@@ -817,8 +815,19 @@ void dibdrv_set_window_surface( DC *dc, struct window_surface *surface ) physdev->surface = surface;
dibdrv = physdev->dibdrv; - bits = window_surface_get_color( surface, info ); - init_dib_info_from_bitmapinfo( &dibdrv->dib, info, bits ); + if (!(bmp = GDI_GetObjPtr( surface->color_bitmap, NTGDI_OBJ_BITMAP ))) + { + static BITMAPINFO info = {.bmiHeader = {.biSize = sizeof(BITMAPINFOHEADER), .biWidth = 1, .biHeight = 1, + .biPlanes = 1, .biBitCount = 32, .biCompression = BI_RGB}}; + static DWORD bits; + + init_dib_info_from_bitmapinfo( &dibdrv->dib, &info, &bits ); + } + else + { + init_dib_info_from_bitmapobj( &dibdrv->dib, bmp ); + GDI_ReleaseObj( surface->color_bitmap ); + } dibdrv->dib.rect = dc->attr->vis_rect; OffsetRect( &dibdrv->dib.rect, -dc->device_rect.left, -dc->device_rect.top ); dibdrv->bounds = &surface->bounds;
From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57584 --- dlls/winex11.drv/bitblt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 757386595f0..267a42bd4c7 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1902,7 +1902,7 @@ static struct window_surface *create_surface( HWND hwnd, Window window, const XV info->bmiHeader.biPlanes = 1; info->bmiHeader.biBitCount = format->bits_per_pixel; info->bmiHeader.biSizeImage = get_dib_image_size( info ); - if (format->bits_per_pixel > 8) set_color_info( vis, info, use_alpha ); + set_color_info( vis, info, use_alpha );
if (!(image = x11drv_image_create( info, vis ))) return NULL;
v4: Mind possibly missing bitmap on dummy surfaces.