From 57a050048aba647cac8478c60c3d919271952e0c Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 25 Jul 2011 15:23:47 +0200 Subject: [PATCH] winex11: Return color information in GetImage when passed null bits. --- dlls/winex11.drv/bitblt.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 2f095172d08..ee60ef863c2 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -2044,6 +2044,17 @@ DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, FIXME( "depth %u bpp %u not supported yet\n", depth, format->bits_per_pixel ); return ERROR_BAD_FORMAT; } + + info->bmiHeader.biSize = sizeof(info->bmiHeader); + info->bmiHeader.biPlanes = 1; + info->bmiHeader.biBitCount = format->bits_per_pixel; + info->bmiHeader.biXPelsPerMeter = 0; + info->bmiHeader.biYPelsPerMeter = 0; + info->bmiHeader.biClrImportant = 0; + set_color_info( dev, color_shifts, info ); + + if (!bits) return ERROR_SUCCESS; /* just querying the color information */ + x = src->visrect.left & ~(align - 1); y = src->visrect.top; width = src->visrect.right - x; @@ -2093,16 +2104,9 @@ DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info, } if (!image) return ERROR_OUTOFMEMORY; - info->bmiHeader.biSize = sizeof(info->bmiHeader); - info->bmiHeader.biWidth = width; - info->bmiHeader.biHeight = -height; - info->bmiHeader.biPlanes = 1; - info->bmiHeader.biBitCount = image->bits_per_pixel; - info->bmiHeader.biSizeImage = height * image->bytes_per_line; - info->bmiHeader.biXPelsPerMeter = 0; - info->bmiHeader.biYPelsPerMeter = 0; - info->bmiHeader.biClrImportant = 0; - set_color_info( dev, color_shifts, info ); + info->bmiHeader.biWidth = width; + info->bmiHeader.biHeight = -height; + info->bmiHeader.biSizeImage = height * image->bytes_per_line; src_bits.ptr = image->data; src_bits.is_copy = TRUE;