From a135e47167214630292907609b10bf3e38397a2a Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 29 Nov 2011 15:12:00 +0100 Subject: [PATCH] gdi32: Don't set gradient alpha channel for 8888 bitmaps created with bitfields. --- dlls/gdi32/dibdrv/bitblt.c | 2 ++ dlls/gdi32/dibdrv/dc.c | 1 + dlls/gdi32/dibdrv/dibdrv.h | 1 + 3 files changed, 4 insertions(+) diff --git a/dlls/gdi32/dibdrv/bitblt.c b/dlls/gdi32/dibdrv/bitblt.c index 3a517aae9e7..9b0dfba8026 100644 --- a/dlls/gdi32/dibdrv/bitblt.c +++ b/dlls/gdi32/dibdrv/bitblt.c @@ -1320,6 +1320,8 @@ BOOL dibdrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert, v[0].y = min( pt[0].y, pt[1].y ); v[1].x = max( pt[0].x, pt[1].x ); v[1].y = max( pt[0].y, pt[1].y ); + if (pdev->dib.funcs == &funcs_8888 && pdev->dib.compression == BI_BITFIELDS) + v[0].Alpha = v[1].Alpha = 0; /* Windows bug: no alpha on a8r8g8b8 created with bitfields */ gradient_rect( &pdev->dib, v, mode, pdev->clip ); } return TRUE; diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c index 1fcf9c18c95..8af8c8568be 100644 --- a/dlls/gdi32/dibdrv/dc.c +++ b/dlls/gdi32/dibdrv/dc.c @@ -73,6 +73,7 @@ BOOL init_dib_info(dib_info *dib, const BITMAPINFOHEADER *bi, const DWORD *bit_f dib->bit_count = bi->biBitCount; dib->width = bi->biWidth; dib->height = bi->biHeight; + dib->compression = bi->biCompression; dib->stride = get_dib_stride( dib->width, dib->bit_count ); dib->bits.ptr = bits; dib->bits.is_copy = FALSE; diff --git a/dlls/gdi32/dibdrv/dibdrv.h b/dlls/gdi32/dibdrv/dibdrv.h index 73ce32bbd6c..5e983cf8f41 100644 --- a/dlls/gdi32/dibdrv/dibdrv.h +++ b/dlls/gdi32/dibdrv/dibdrv.h @@ -26,6 +26,7 @@ enum dib_info_flags typedef struct { int bit_count, width, height; + int compression; int stride; /* stride in bytes. Will be -ve for bottom-up dibs (see bits). */ struct gdi_image_bits bits; /* bits.ptr points to the top-left corner of the dib. */ -- 2.11.4.GIT