Optimized StretchDIBits to call SetDIBitsToDevice (when src & dst
dimensions are equal).
This commit is contained in:
parent
73077e3d61
commit
2818a67635
@ -135,8 +135,15 @@ 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,
|
||||||
@ -157,11 +164,10 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
|
|||||||
SelectObject( hdcMem, hOldBitmap );
|
SelectObject( hdcMem, hOldBitmap );
|
||||||
DeleteDC( hdcMem );
|
DeleteDC( hdcMem );
|
||||||
DeleteObject( hBitmap );
|
DeleteObject( hBitmap );
|
||||||
return heightSrc;
|
|
||||||
}
|
}
|
||||||
|
return heightSrc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* SetDIBits16 (GDI.440)
|
* SetDIBits16 (GDI.440)
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user