Alexandre Julliard : gdi32: Always use proper RGB colors for monochrome DDB pattern brushes.

Alexandre Julliard julliard at winehq.org
Fri Dec 23 13:03:22 CST 2011


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Dec 22 21:18:30 2011 +0100

gdi32: Always use proper RGB colors for monochrome DDB pattern brushes.

---

 dlls/gdi32/dibdrv/objects.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c
index 85fbbbc..96596df 100644
--- a/dlls/gdi32/dibdrv/objects.c
+++ b/dlls/gdi32/dibdrv/objects.c
@@ -1589,16 +1589,24 @@ static BOOL select_pattern_brush( dibdrv_physdev *pdev, BOOL *needs_reselect )
     if (pattern.bit_count == 1 && !pattern.color_table)
     {
         /* monochrome DDB pattern uses DC colors */
-        COLORREF color = GetTextColor( pdev->dev.hdc );
+        DWORD pixel;
+        BOOL got_pixel;
+        COLORREF color;
+
+        color = make_rgb_colorref( pdev->dev.hdc, &pdev->dib, GetTextColor( pdev->dev.hdc ),
+                                   &got_pixel, &pixel );
         color_table[0].rgbRed      = GetRValue( color );
         color_table[0].rgbGreen    = GetGValue( color );
         color_table[0].rgbBlue     = GetBValue( color );
         color_table[0].rgbReserved = 0;
-        color = GetBkColor( pdev->dev.hdc );
+
+        color = make_rgb_colorref( pdev->dev.hdc, &pdev->dib, GetBkColor( pdev->dev.hdc ),
+                                   &got_pixel, &pixel );
         color_table[1].rgbRed      = GetRValue( color );
         color_table[1].rgbGreen    = GetGValue( color );
         color_table[1].rgbBlue     = GetBValue( color );
         color_table[1].rgbReserved = 0;
+
         pattern.color_table = color_table;
         pattern.color_table_size = 2;
         *needs_reselect = TRUE;




More information about the wine-cvs mailing list