Alexandre Julliard : gdi32: Store the return value separately in StretchDIBits instead of overwriting heightSrc .
Alexandre Julliard
julliard at winehq.org
Thu Mar 27 07:21:53 CDT 2008
Module: wine
Branch: master
Commit: 6e387f34c588fa6f2e634cdb1e215dda056bb270
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6e387f34c588fa6f2e634cdb1e215dda056bb270
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Mar 26 20:51:58 2008 +0100
gdi32: Store the return value separately in StretchDIBits instead of overwriting heightSrc.
---
dlls/gdi32/dib.c | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c
index 3205d0d..2b5ae37 100644
--- a/dlls/gdi32/dib.c
+++ b/dlls/gdi32/dib.c
@@ -188,18 +188,19 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
const BITMAPINFO *info, UINT wUsage, DWORD dwRop )
{
DC *dc;
+ INT ret;
if (!bits || !info)
return 0;
- if (!(dc = get_dc_ptr( hdc ))) return FALSE;
+ if (!(dc = get_dc_ptr( hdc ))) return 0;
if(dc->funcs->pStretchDIBits)
{
update_dc( dc );
- heightSrc = dc->funcs->pStretchDIBits(dc->physDev, xDst, yDst, widthDst,
- heightDst, xSrc, ySrc, widthSrc,
- heightSrc, bits, info, wUsage, dwRop);
+ ret = dc->funcs->pStretchDIBits(dc->physDev, xDst, yDst, widthDst,
+ heightDst, xSrc, ySrc, widthSrc,
+ heightSrc, bits, info, wUsage, dwRop);
release_dc_ptr( dc );
}
else /* use StretchBlt */
@@ -248,7 +249,7 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
{
/* fast path */
TRACE("using fast path\n");
- heightSrc = SetDIBits( hdc, hBitmap, 0, height, bits, info, wUsage);
+ ret = SetDIBits( hdc, hBitmap, 0, height, bits, info, wUsage);
}
else
{
@@ -290,13 +291,13 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
dwRop );
}
- heightSrc = SetDIBits(hdcMem, hBitmap, 0, height, bits, info, wUsage);
+ ret = SetDIBits(hdcMem, hBitmap, 0, height, bits, info, wUsage);
/* Origin for DIBitmap may be bottom left (positive biHeight) or top
left (negative biHeight) */
- if (heightSrc) StretchBlt( hdc, xDst, yDst, widthDst, heightDst,
- hdcMem, xSrc, abs(height) - heightSrc - ySrc,
- widthSrc, heightSrc, dwRop );
+ if (ret) StretchBlt( hdc, xDst, yDst, widthDst, heightDst,
+ hdcMem, xSrc, abs(height) - heightSrc - ySrc,
+ widthSrc, heightSrc, dwRop );
if(hpal)
SelectPalette(hdcMem, hpal, FALSE);
SelectObject( hdcMem, hOldBitmap );
@@ -304,7 +305,7 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
DeleteObject( hBitmap );
}
}
- return heightSrc;
+ return ret;
}
More information about the wine-cvs
mailing list