Backed out previous change (breaks with metafiles).

This commit is contained in:
Alexandre Julliard 1999-10-13 16:16:23 +00:00
parent 019211f864
commit 54e477588c

View File

@ -135,39 +135,33 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
const BITMAPINFO *info, UINT wUsage, DWORD dwRop ) const BITMAPINFO *info, UINT wUsage, DWORD dwRop )
{ {
DC *dc = DC_GetDCPtr( hdc ); DC *dc = DC_GetDCPtr( hdc );
if(!dc) return FALSE; if(!dc) return FALSE;
if (widthDst == widthSrc && heightDst == heightSrc && dwRop == SRCCOPY) {
return SetDIBitsToDevice( hdc, xDst, yDst, widthDst, heightDst,
xSrc, ySrc, 0, info->bmiHeader.biHeight,
bits, info, 0/*FIXME coloruse*/ );
}
if(dc->funcs->pStretchDIBits) if(dc->funcs->pStretchDIBits)
return dc->funcs->pStretchDIBits(dc, xDst, yDst, widthDst, return dc->funcs->pStretchDIBits(dc, xDst, yDst, widthDst,
heightDst, xSrc, ySrc, widthSrc, heightDst, xSrc, ySrc, widthSrc,
heightSrc, bits, info, wUsage, heightSrc, bits, info, wUsage,
dwRop); dwRop);
else { /* use StretchBlt32 */ else { /* use StretchBlt32 */
HBITMAP hBitmap, hOldBitmap; HBITMAP hBitmap, hOldBitmap;
HDC hdcMem; HDC hdcMem;
hBitmap = CreateDIBitmap( hdc, &info->bmiHeader, CBM_INIT, hBitmap = CreateDIBitmap( hdc, &info->bmiHeader, CBM_INIT,
bits, info, wUsage ); bits, info, wUsage );
hdcMem = CreateCompatibleDC( hdc ); hdcMem = CreateCompatibleDC( hdc );
hOldBitmap = SelectObject( hdcMem, hBitmap ); hOldBitmap = SelectObject( hdcMem, hBitmap );
/* Origin for DIBitmap is bottom left ! */ /* Origin for DIBitmap is bottom left ! */
StretchBlt( hdc, xDst, yDst, widthDst, heightDst, StretchBlt( hdc, xDst, yDst, widthDst, heightDst,
hdcMem, xSrc, info->bmiHeader.biHeight - heightSrc - ySrc, hdcMem, xSrc, info->bmiHeader.biHeight - heightSrc - ySrc,
widthSrc, heightSrc, dwRop ); widthSrc, heightSrc, dwRop );
SelectObject( hdcMem, hOldBitmap ); SelectObject( hdcMem, hOldBitmap );
DeleteDC( hdcMem ); DeleteDC( hdcMem );
DeleteObject( hBitmap ); DeleteObject( hBitmap );
return heightSrc;
} }
return heightSrc;
} }
/*********************************************************************** /***********************************************************************
* SetDIBits16 (GDI.440) * SetDIBits16 (GDI.440)
*/ */