Module: wine Branch: master Commit: f5bffe0ef7afbeb2528f8025283d0fd887f4271e URL: http://source.winehq.org/git/wine.git/?a=commit;h=f5bffe0ef7afbeb2528f802528...
Author: Huw Davies huw@codeweavers.com Date: Wed Jul 13 10:02:27 2016 +0100
gdi32: Use the get_mono_dc_colors() helper.
Signed-off-by: Huw Davies huw@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/gdi32/bitblt.c | 2 +- dlls/gdi32/dib.c | 9 +-------- dlls/gdi32/gdi_private.h | 1 + 3 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/dlls/gdi32/bitblt.c b/dlls/gdi32/bitblt.c index d2b3de2..ed011fc 100644 --- a/dlls/gdi32/bitblt.c +++ b/dlls/gdi32/bitblt.c @@ -222,7 +222,7 @@ static DWORD blend_bits( const BITMAPINFO *src_info, const struct gdi_image_bits }
/* helper to retrieve either both colors or only the background color for monochrome blits */ -static void get_mono_dc_colors( HDC hdc, BITMAPINFO *info, int count ) +void get_mono_dc_colors( HDC hdc, BITMAPINFO *info, int count ) { RGBQUAD *colors = info->bmiColors; COLORREF color = GetBkColor( hdc ); diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index ad2bf4f..c3009a2 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -581,14 +581,7 @@ INT nulldrv_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT he if (dst_info->bmiHeader.biBitCount == 1 && !dst_colors) { if (src_info->bmiHeader.biBitCount > 1) - { - COLORREF color = GetBkColor( dev->hdc ); - dst_info->bmiColors[0].rgbRed = GetRValue( color ); - dst_info->bmiColors[0].rgbGreen = GetGValue( color ); - dst_info->bmiColors[0].rgbBlue = GetBValue( color ); - dst_info->bmiColors[0].rgbReserved = 0; - dst_info->bmiHeader.biClrUsed = 1; - } + get_mono_dc_colors( dev->hdc, dst_info, 1 ); else { memcpy( dst_info->bmiColors, src_info->bmiColors, 2 * sizeof(dst_info->bmiColors[0]) ); diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 79a7a74..8bdf9f1 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -205,6 +205,7 @@ extern BOOL intersect_vis_rectangles( struct bitblt_coords *dst, struct bitblt_c extern DWORD stretch_bits( const BITMAPINFO *src_info, struct bitblt_coords *src, BITMAPINFO *dst_info, struct bitblt_coords *dst, struct gdi_image_bits *bits, int mode ) DECLSPEC_HIDDEN; +extern void get_mono_dc_colors( HDC hdc, BITMAPINFO *info, int count ) DECLSPEC_HIDDEN;
/* brush.c */ extern BOOL store_brush_pattern( LOGBRUSH *brush, struct brush_pattern *pattern ) DECLSPEC_HIDDEN;