Vladimir Panteleev : winex11: Correctly handle non-RGB COLORREFs in BRUSH_SelectSolidBrush.

Alexandre Julliard julliard at winehq.org
Mon Nov 8 11:46:19 CST 2010


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

Author: Vladimir Panteleev <vladimir at thecybershadow.net>
Date:   Sun Nov  7 04:38:02 2010 +0200

winex11: Correctly handle non-RGB COLORREFs in BRUSH_SelectSolidBrush.

---

 dlls/winex11.drv/brush.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/dlls/winex11.drv/brush.c b/dlls/winex11.drv/brush.c
index ffbf4cb..61f1a86 100644
--- a/dlls/winex11.drv/brush.c
+++ b/dlls/winex11.drv/brush.c
@@ -183,17 +183,18 @@ static Pixmap BRUSH_DitherMono( COLORREF color )
  */
 static void BRUSH_SelectSolidBrush( X11DRV_PDEVICE *physDev, COLORREF color )
 {
+    COLORREF colorRGB = X11DRV_PALETTE_GetColor( physDev, color );
     if ((physDev->depth > 1) && (screen_depth <= 8) && !X11DRV_IsSolidColor( color ))
     {
 	  /* Dithered brush */
-	physDev->brush.pixmap = BRUSH_DitherColor( color, physDev->depth );
+	physDev->brush.pixmap = BRUSH_DitherColor( colorRGB, physDev->depth );
 	physDev->brush.fillStyle = FillTiled;
 	physDev->brush.pixel = 0;
     }
-    else if (physDev->depth == 1 && color != WHITE && color != BLACK)
+    else if (physDev->depth == 1 && colorRGB != WHITE && colorRGB != BLACK)
     {
 	physDev->brush.pixel = 0;
-	physDev->brush.pixmap = BRUSH_DitherMono( color );
+	physDev->brush.pixmap = BRUSH_DitherMono( colorRGB );
 	physDev->brush.fillStyle = FillTiled;
     }
     else




More information about the wine-cvs mailing list