gdi/mfdrv BS_PATTERN brushes

Walt Ogburn reuben at ugcs.caltech.edu
Mon Nov 29 23:16:49 CST 2004


Hmm, an intervening patch made mine not apply correctly.  One more time:

>
> Re-submitting.
>
> This fixes the problem that Emanuele Gisi reported last month in the Aloha
> problem.  With this patch BS_PATTERN brushes get created correctly and
> don't cause a locking problem.
>
> Changelog:
> Fix creation of BS_PATTERN brushes in mfdrv


Index: dlls/gdi/mfdrv/objects.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/mfdrv/objects.c,v
retrieving revision 1.14
diff -u -r1.14 objects.c
--- dlls/gdi/mfdrv/objects.c    22 Nov 2004 18:19:59 -0000      1.14
+++ dlls/gdi/mfdrv/objects.c    30 Nov 2004 06:10:03 -0000
@@ -172,14 +172,13 @@
                goto done;
            }

-           bmSize = DIB_GetDIBImageBytes(bm.bmWidth, bm.bmHeight, DIB_PAL_COLORS);
-
+           bmSize = 2 * ((bm.bmWidth + 15) >> 4) * bm.bmHeight;
            size = sizeof(METARECORD) + sizeof(WORD) + sizeof(BITMAPINFO)
+
-             sizeof(RGBQUAD) + bmSize;
+             bmSize;

            mr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
            if(!mr) goto done;
-           mr->rdFunction = META_DIBCREATEPATTERNBRUSH;
+           mr->rdFunction = META_CREATEPATTERNBRUSH;
            mr->rdSize = size / 2;
            mr->rdParm[0] = BS_PATTERN;
            mr->rdParm[1] = DIB_RGB_COLORS;
@@ -190,12 +189,13 @@
            info->bmiHeader.biHeight = bm.bmHeight;
            info->bmiHeader.biPlanes = 1;
            info->bmiHeader.biBitCount = 1;
-           bits = ((BYTE *)info) + sizeof(BITMAPINFO) + sizeof(RGBQUAD);
+           bits = ((BYTE *)info) + sizeof(BITMAPINFO);
+           memcpy(bits, bm.bmBits, bmSize);

-           GetDIBits(physDev->hdc, (HANDLE)logbrush.lbHatch, 0, bm.bmHeight,
-                     bits, info, DIB_RGB_COLORS);
+           /* In principle, color should be GetTextColor(physDev->hdc); */
+           /* here, it doesn't really get used, so set to zero */
            *(DWORD *)info->bmiColors = 0;
-           *(DWORD *)(info->bmiColors + 1) = 0xffffff;
+
            break;
        }




More information about the wine-patches mailing list