Alexandre Julliard : gdi32: Always return the full DIB surface in GetImage and adjust coordinates accordingly .
Alexandre Julliard
julliard at winehq.org
Mon Oct 15 14:29:06 CDT 2012
Module: wine
Branch: master
Commit: 36f2b09632261d6f5467e4c4cc20e561f5baec4d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=36f2b09632261d6f5467e4c4cc20e561f5baec4d
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Oct 15 14:16:28 2012 +0200
gdi32: Always return the full DIB surface in GetImage and adjust coordinates accordingly.
Based on a patch by Ken Thomases.
---
dlls/gdi32/dibdrv/bitblt.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/dlls/gdi32/dibdrv/bitblt.c b/dlls/gdi32/dibdrv/bitblt.c
index ccddac9..e65dcbc 100644
--- a/dlls/gdi32/dibdrv/bitblt.c
+++ b/dlls/gdi32/dibdrv/bitblt.c
@@ -816,7 +816,7 @@ static DWORD get_image_dib_info( dib_info *dib, BITMAPINFO *info,
info->bmiHeader.biYPelsPerMeter = 0;
info->bmiHeader.biClrImportant = 0;
info->bmiHeader.biWidth = dib->width;
- info->bmiHeader.biHeight = dib->height - dib->rect.top;
+ info->bmiHeader.biHeight = dib->height;
info->bmiHeader.biBitCount = dib->bit_count;
info->bmiHeader.biSizeImage = info->bmiHeader.biHeight * abs( dib->stride );
if (dib->stride > 0) info->bmiHeader.biHeight = -info->bmiHeader.biHeight;
@@ -825,14 +825,13 @@ static DWORD get_image_dib_info( dib_info *dib, BITMAPINFO *info,
if (bits)
{
- if (dib->stride < 0)
- bits->ptr = (char *)dib->bits.ptr + (dib->rect.bottom - 1) * dib->stride;
- else
- bits->ptr = (char *)dib->bits.ptr + dib->rect.top * dib->stride;
+ bits->ptr = dib->bits.ptr;
bits->is_copy = FALSE;
bits->free = NULL;
+ if (dib->stride < 0) bits->ptr = (char *)bits->ptr + (dib->height - 1) * dib->stride;
src->x += dib->rect.left;
- offset_rect( &src->visrect, dib->rect.left, 0 );
+ src->y += dib->rect.top;
+ offset_rect( &src->visrect, dib->rect.left, dib->rect.top );
}
return ERROR_SUCCESS;
}
More information about the wine-cvs
mailing list