Alexandre Julliard : gdi32: Don' t use the DC colors when drawing a monochrome pattern to a monochrome DDB.
Alexandre Julliard
julliard at winehq.org
Thu May 24 14:58:12 CDT 2012
Module: wine
Branch: master
Commit: 8a86f6c99329fd5a325428f4824580131a8fd767
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8a86f6c99329fd5a325428f4824580131a8fd767
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed May 23 12:30:23 2012 +0200
gdi32: Don't use the DC colors when drawing a monochrome pattern to a monochrome DDB.
---
dlls/gdi32/dibdrv/objects.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c
index d865768..dd47ee1 100644
--- a/dlls/gdi32/dibdrv/objects.c
+++ b/dlls/gdi32/dibdrv/objects.c
@@ -1870,6 +1870,9 @@ static BOOL select_pattern_brush( dibdrv_physdev *pdev, dib_brush *brush, BOOL *
dib_info pattern;
BOOL dither = (brush->dib.bit_count == 1);
+ if (pattern.bit_count == 1 && !pattern.color_table)
+ dither = FALSE; /* monochrome DDB pattern brushes don't get dithered */
+
if (!brush->pattern.info)
{
BITMAPOBJ *bmp = GDI_GetObjPtr( brush->pattern.bitmap, OBJ_BITMAP );
@@ -1892,7 +1895,8 @@ static BOOL select_pattern_brush( dibdrv_physdev *pdev, dib_brush *brush, BOOL *
init_dib_info_from_bitmapinfo( &pattern, brush->pattern.info, brush->pattern.bits.ptr );
}
- if (pattern.bit_count == 1 && !pattern.color_table)
+ if (pattern.bit_count == 1 && !pattern.color_table &&
+ (pdev->dib.bit_count != 1 || pdev->dib.color_table))
{
/* monochrome DDB pattern uses DC colors */
DWORD pixel;
@@ -1916,7 +1920,6 @@ static BOOL select_pattern_brush( dibdrv_physdev *pdev, dib_brush *brush, BOOL *
pattern.color_table = color_table;
pattern.color_table_size = 2;
*needs_reselect = TRUE;
- dither = FALSE; /* DDB pattern brushes don't get dithered */
}
copy_dib_color_info(&brush->dib, &pdev->dib);
More information about the wine-cvs
mailing list