Alexandre Julliard : gdi32: Don' t set gradient alpha channel for 8888 bitmaps created with bitfields.

Alexandre Julliard julliard at winehq.org
Tue Nov 29 14:20:39 CST 2011


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Nov 29 15:12:00 2011 +0100

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(+), 0 deletions(-)

diff --git a/dlls/gdi32/dibdrv/bitblt.c b/dlls/gdi32/dibdrv/bitblt.c
index 3a517aa..9b0dfba 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 1fcf9c1..8af8c85 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 73ce32b..5e983cf 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. */
 




More information about the wine-cvs mailing list