Huw Davies : wineps: Use the correct colours when a monochrome bitmap without a colour table is the source.

Alexandre Julliard julliard at winehq.org
Mon Feb 24 15:42:31 CST 2014


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Mon Feb 24 15:11:57 2014 +0000

wineps: Use the correct colours when a monochrome bitmap without a colour table is the source.

---

 dlls/wineps.drv/bitmap.c |   21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/dlls/wineps.drv/bitmap.c b/dlls/wineps.drv/bitmap.c
index f5a5547..c4d0a96 100644
--- a/dlls/wineps.drv/bitmap.c
+++ b/dlls/wineps.drv/bitmap.c
@@ -101,6 +101,7 @@ static BOOL PSDRV_WriteImageMaskHeader(PHYSDEV dev, const BITMAPINFO *info, INT
                                        INT widthSrc, INT heightSrc)
 {
     PSCOLOR bkgnd, foregnd;
+    PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
 
     assert(info->bmiHeader.biBitCount == 1);
 
@@ -108,12 +109,20 @@ static BOOL PSDRV_WriteImageMaskHeader(PHYSDEV dev, const BITMAPINFO *info, INT
        the foregnd color corresponds to a bit equal to
        0 in the bitmap.
     */
-    PSDRV_CreateColor(dev, &foregnd, RGB(info->bmiColors[0].rgbRed,
-                                         info->bmiColors[0].rgbGreen,
-                                         info->bmiColors[0].rgbBlue) );
-    PSDRV_CreateColor(dev, &bkgnd, RGB(info->bmiColors[1].rgbRed,
-                                       info->bmiColors[1].rgbGreen,
-                                       info->bmiColors[1].rgbBlue) );
+    if (!info->bmiHeader.biClrUsed)
+    {
+        PSDRV_CreateColor( dev, &foregnd, GetTextColor( dev->hdc ) );
+        bkgnd = physDev->bkColor;
+    }
+    else
+    {
+        PSDRV_CreateColor( dev, &foregnd, RGB(info->bmiColors[0].rgbRed,
+                                              info->bmiColors[0].rgbGreen,
+                                              info->bmiColors[0].rgbBlue) );
+        PSDRV_CreateColor( dev, &bkgnd, RGB(info->bmiColors[1].rgbRed,
+                                            info->bmiColors[1].rgbGreen,
+                                            info->bmiColors[1].rgbBlue) );
+    }
 
     PSDRV_WriteGSave(dev);
     PSDRV_WriteNewPath(dev);




More information about the wine-cvs mailing list