gdi: device bitmap fix

Huw D M Davies h.davies1 at physics.ox.ac.uk
Fri Aug 13 11:01:00 CDT 2004


        Huw Davies <huw at codeweavers.com>
        If a device doesn't support device bitmaps, then store the
        bits on the gdi side.
-- 
Huw Davies
huw at codeweavers.com
Index: dlls/gdi/bitmap.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/bitmap.c,v
retrieving revision 1.1
diff -u -r1.1 bitmap.c
--- dlls/gdi/bitmap.c	21 Jul 2004 04:07:28 -0000	1.1
+++ dlls/gdi/bitmap.c	13 Aug 2004 15:58:31 -0000
@@ -265,16 +265,10 @@
           hbitmap, count, bits, bmp->bitmap.bmWidth, bmp->bitmap.bmHeight,
           1 << bmp->bitmap.bmBitsPixel, height );
 
-    if(bmp->funcs)
+    if(bmp->funcs && bmp->funcs->pGetBitmapBits)
     {
         TRACE("Calling device specific BitmapBits\n");
-        if(bmp->funcs->pGetBitmapBits)
-            ret = bmp->funcs->pGetBitmapBits(hbitmap, bits, count);
-        else
-        {
-            memset( bits, 0, count );
-            ret = count;
-        }
+        ret = bmp->funcs->pGetBitmapBits(hbitmap, bits, count);
     } else {
 
         if(!bmp->bitmap.bmBits) {
@@ -326,13 +320,10 @@
           hbitmap, count, bits, bmp->bitmap.bmWidth, bmp->bitmap.bmHeight,
           1 << bmp->bitmap.bmBitsPixel, height );
 
-    if(bmp->funcs) {
+    if(bmp->funcs && bmp->funcs->pSetBitmapBits) {
 
         TRACE("Calling device specific BitmapBits\n");
-        if(bmp->funcs->pSetBitmapBits)
-            ret = bmp->funcs->pSetBitmapBits(hbitmap, bits, count);
-        else
-            ret = 0;
+        ret = bmp->funcs->pSetBitmapBits(hbitmap, bits, count);
     } else {
 
         if(!bmp->bitmap.bmBits) /* Alloc enough for entire bitmap */



More information about the wine-patches mailing list