gdi32: Always use BI_BITFIELDS for 16-bpp in GetImage.

This commit is contained in:
Alexandre Julliard 2011-08-05 12:33:58 +02:00
parent c668354cc0
commit 3a1194edd7
3 changed files with 17 additions and 17 deletions

View File

@ -67,6 +67,14 @@ DWORD nulldrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
info->bmiHeader.biYPelsPerMeter = 0;
info->bmiHeader.biClrUsed = 0;
info->bmiHeader.biClrImportant = 0;
if (bmp->bitmap.bmBitsPixel == 16)
{
DWORD *masks = (DWORD *)info->bmiColors;
masks[0] = 0x7c00;
masks[1] = 0x03e0;
masks[2] = 0x001f;
info->bmiHeader.biCompression = BI_BITFIELDS;
}
if (!bits) goto done;
height = src->visrect.bottom - src->visrect.top;

View File

@ -339,6 +339,8 @@ static BOOL dibdrv_DeleteDC( PHYSDEV dev )
static void set_color_info( const dib_info *dib, BITMAPINFO *info )
{
DWORD *masks = (DWORD *)info->bmiColors;
info->bmiHeader.biCompression = BI_RGB;
info->bmiHeader.biClrUsed = 0;
@ -355,19 +357,14 @@ static void set_color_info( const dib_info *dib, BITMAPINFO *info )
}
break;
case 16:
if (dib->funcs != &funcs_555)
{
DWORD *masks = (DWORD *)info->bmiColors;
masks[0] = dib->red_mask;
masks[1] = dib->green_mask;
masks[2] = dib->blue_mask;
info->bmiHeader.biCompression = BI_BITFIELDS;
}
masks[0] = dib->red_mask;
masks[1] = dib->green_mask;
masks[2] = dib->blue_mask;
info->bmiHeader.biCompression = BI_BITFIELDS;
break;
case 32:
if (dib->funcs != &funcs_8888)
{
DWORD *masks = (DWORD *)info->bmiColors;
masks[0] = dib->red_mask;
masks[1] = dib->green_mask;
masks[2] = dib->blue_mask;
@ -417,12 +414,8 @@ static DWORD dibdrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
}
break;
case 16:
if (bmp->dib->dsBmih.biCompression == BI_BITFIELDS &&
memcmp( bmp->dib->dsBitfields, bit_fields_555, sizeof(bmp->dib->dsBitfields) ))
{
info->bmiHeader.biCompression = BI_BITFIELDS;
memcpy( info->bmiColors, bmp->dib->dsBitfields, sizeof(bmp->dib->dsBitfields) );
}
info->bmiHeader.biCompression = BI_BITFIELDS;
memcpy( info->bmiColors, bmp->dib->dsBitfields, sizeof(bmp->dib->dsBitfields) );
break;
case 32:
if (bmp->dib->dsBmih.biCompression == BI_BITFIELDS &&

View File

@ -1641,8 +1641,7 @@ static void set_color_info( PHYSDEV dev, const ColorShifts *color_shifts, BITMAP
colors[0] = color_shifts->logicalRed.max << color_shifts->logicalRed.shift;
colors[1] = color_shifts->logicalGreen.max << color_shifts->logicalGreen.shift;
colors[2] = color_shifts->logicalBlue.max << color_shifts->logicalBlue.shift;
if (colors[0] != 0x7c00 || colors[1] != 0x03e0 || colors[2] != 0x001f)
info->bmiHeader.biCompression = BI_BITFIELDS;
info->bmiHeader.biCompression = BI_BITFIELDS;
break;
case 32:
colors[0] = color_shifts->logicalRed.max << color_shifts->logicalRed.shift;