Module: wine Branch: master Commit: 66774baba3e67f8c6002f7954401abd7ae625444 URL: http://source.winehq.org/git/wine.git/?a=commit;h=66774baba3e67f8c6002f79544...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Jan 9 19:38:54 2012 +0100
gdi32: Use the bpp info from the bitmap structure now that it's identical to the DIB one.
---
dlls/gdi32/bitmap.c | 9 +++------ dlls/gdi32/dib.c | 26 +++++++++----------------- 2 files changed, 12 insertions(+), 23 deletions(-)
diff --git a/dlls/gdi32/bitmap.c b/dlls/gdi32/bitmap.c index dcccd3d..ab93525 100644 --- a/dlls/gdi32/bitmap.c +++ b/dlls/gdi32/bitmap.c @@ -342,9 +342,7 @@ LONG WINAPI GetBitmapBits( if (!bmp) return 0; funcs = get_bitmap_funcs( bmp );
- if (bmp->dib) dst_stride = get_bitmap_stride( bmp->dib->dsBmih.biWidth, bmp->dib->dsBmih.biBitCount ); - else dst_stride = get_bitmap_stride( bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel ); - + dst_stride = get_bitmap_stride( bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel ); ret = max = dst_stride * bmp->bitmap.bmHeight; if (!bits) goto done; if (count > max) count = max; @@ -426,8 +424,7 @@ LONG WINAPI SetBitmapBits( count = -count; }
- if (bmp->dib) src_stride = get_bitmap_stride( bmp->dib->dsBmih.biWidth, bmp->dib->dsBmih.biBitCount ); - else src_stride = get_bitmap_stride( bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel ); + src_stride = get_bitmap_stride( bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel ); count = min( count, src_stride * bmp->bitmap.bmHeight );
dst_stride = get_dib_stride( bmp->bitmap.bmWidth, bmp->bitmap.bmBitsPixel ); @@ -481,7 +478,7 @@ LONG WINAPI SetBitmapBits( /* query the color info */ info->bmiHeader.biSize = sizeof(info->bmiHeader); info->bmiHeader.biPlanes = 1; - info->bmiHeader.biBitCount = bmp->dib ? bmp->dib->dsBmih.biBitCount : bmp->bitmap.bmBitsPixel; + info->bmiHeader.biBitCount = bmp->bitmap.bmBitsPixel; info->bmiHeader.biCompression = BI_RGB; info->bmiHeader.biXPelsPerMeter = 0; info->bmiHeader.biYPelsPerMeter = 0; diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index 3a8fadb..143cc47 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -975,25 +975,17 @@ static int fill_query_info( BITMAPINFO *info, BITMAPOBJ *bmp ) header.biWidth = bmp->bitmap.bmWidth; header.biHeight = bmp->bitmap.bmHeight; header.biPlanes = 1; + header.biBitCount = bmp->bitmap.bmBitsPixel;
- if (bmp->dib) + switch (header.biBitCount) { - header.biBitCount = bmp->dib->dsBm.bmBitsPixel; - switch (bmp->dib->dsBm.bmBitsPixel) - { - case 16: - case 32: - header.biCompression = BI_BITFIELDS; - break; - default: - header.biCompression = BI_RGB; - break; - } - } - else - { - header.biCompression = (bmp->bitmap.bmBitsPixel > 8) ? BI_BITFIELDS : BI_RGB; - header.biBitCount = bmp->bitmap.bmBitsPixel; + case 16: + case 32: + header.biCompression = BI_BITFIELDS; + break; + default: + header.biCompression = BI_RGB; + break; }
header.biSizeImage = get_dib_image_size( (BITMAPINFO *)&header );