gdi32: Calculate the stride from the image size.

This allows bitmaps to be created by D3DKMTCreateDCFromMemory() which have more freedom
in their choice of stride.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2017-02-13 14:08:04 +00:00 committed by Alexandre Julliard
parent a4f0415a5b
commit 0bec2f7965

View File

@ -154,7 +154,10 @@ static void init_dib_info(dib_info *dib, const BITMAPINFOHEADER *bi, int stride,
void init_dib_info_from_bitmapinfo(dib_info *dib, const BITMAPINFO *info, void *bits)
{
init_dib_info( dib, &info->bmiHeader, get_dib_stride( info->bmiHeader.biWidth, info->bmiHeader.biBitCount ),
int width_bytes = get_dib_stride( info->bmiHeader.biWidth, info->bmiHeader.biBitCount );
if (info->bmiHeader.biSizeImage)
width_bytes = info->bmiHeader.biSizeImage / abs( info->bmiHeader.biHeight );
init_dib_info( dib, &info->bmiHeader, width_bytes,
(const DWORD *)info->bmiColors, info->bmiColors, bits );
}