Alexandre Julliard : winex11: Return color information in GetImage when passed null bits.

Alexandre Julliard julliard at winehq.org
Mon Jul 25 11:43:14 CDT 2011


Module: wine
Branch: master
Commit: 57a050048aba647cac8478c60c3d919271952e0c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=57a050048aba647cac8478c60c3d919271952e0c

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jul 25 15:23:47 2011 +0200

winex11: Return color information in GetImage when passed null bits.

---

 dlls/winex11.drv/bitblt.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c
index 2f09517..ee60ef8 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;




More information about the wine-cvs mailing list