Huw Davies : gdi32: Initialise the bit fields even in the BI_RGB case in order to make format comparisons easier .
Alexandre Julliard
julliard at winehq.org
Wed May 11 13:02:57 CDT 2011
Module: wine
Branch: master
Commit: 93349f02adf41e549f219af411447dd527eb4852
URL: http://source.winehq.org/git/wine.git/?a=commit;h=93349f02adf41e549f219af411447dd527eb4852
Author: Huw Davies <huw at codeweavers.com>
Date: Wed May 11 15:13:40 2011 +0100
gdi32: Initialise the bit fields even in the BI_RGB case in order to make format comparisons easier.
---
dlls/gdi32/dibdrv/dc.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c
index 5273b29..e43ec15 100644
--- a/dlls/gdi32/dibdrv/dc.c
+++ b/dlls/gdi32/dibdrv/dc.c
@@ -76,6 +76,8 @@ static void init_bit_fields(dib_info *dib, const DWORD *bit_fields)
static BOOL init_dib(dib_info *dib, const BITMAPINFOHEADER *bi, const DWORD *bit_fields, void *bits)
{
+ static const DWORD bit_fields_888[3] = {0xff0000, 0x00ff00, 0x0000ff};
+
dib->bit_count = bi->biBitCount;
dib->width = bi->biWidth;
dib->height = bi->biHeight;
@@ -99,15 +101,14 @@ static BOOL init_dib(dib_info *dib, const BITMAPINFOHEADER *bi, const DWORD *bit
{
case 32:
if(bi->biCompression == BI_RGB)
+ bit_fields = bit_fields_888;
+
+ init_bit_fields(dib, bit_fields);
+
+ if(dib->red_mask == 0xff0000 && dib->green_mask == 0x00ff00 && dib->blue_mask == 0x0000ff)
dib->funcs = &funcs_8888;
else
- {
- init_bit_fields(dib, bit_fields);
- if(dib->red_mask == 0xff0000 && dib->green_mask == 0x00ff00 && dib->blue_mask == 0x0000ff)
- dib->funcs = &funcs_8888;
- else
- dib->funcs = &funcs_32;
- }
+ dib->funcs = &funcs_32;
break;
default:
More information about the wine-cvs
mailing list