- Use NtGdiBitBlt in NtGdiStretchDIBits if source and destination dimensions are equal.

svn path=/trunk/; revision=9396
This commit is contained in:
Filip Navara 2004-05-15 11:20:38 +00:00
parent 39fee6b8c7
commit 4e81b67c89

View file

@ -1,5 +1,5 @@
/* /*
* $Id: dib.c,v 1.47 2004/05/15 08:52:25 navaraf Exp $ * $Id: dib.c,v 1.48 2004/05/15 11:20:38 navaraf Exp $
* *
* ReactOS W32 Subsystem * ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
@ -810,9 +810,13 @@ INT STDCALL NtGdiStretchDIBits(HDC hDC,
BitsInfo->bmiHeader.biCompression == BI_RLE8) BitsInfo->bmiHeader.biCompression == BI_RLE8)
{ {
/* copy existing bitmap from destination dc */ /* copy existing bitmap from destination dc */
NtGdiStretchBlt(hdcMem, XSrc, abs(BitsInfo->bmiHeader.biHeight) - SrcHeight - YSrc, if (SrcWidth == DestWidth && SrcHeight == DestHeight)
SrcWidth, SrcHeight, hDC, XDest, YDest, DestWidth, DestHeight, NtGdiBitBlt(hdcMem, XSrc, abs(BitsInfo->bmiHeader.biHeight) - SrcHeight - YSrc,
ROP); SrcWidth, SrcHeight, hDC, XDest, YDest, ROP);
else
NtGdiStretchBlt(hdcMem, XSrc, abs(BitsInfo->bmiHeader.biHeight) - SrcHeight - YSrc,
SrcWidth, SrcHeight, hDC, XDest, YDest, DestWidth, DestHeight,
ROP);
} }
NtGdiSetDIBits(hdcMem, hBitmap, 0, BitsInfo->bmiHeader.biHeight, Bits, NtGdiSetDIBits(hdcMem, hBitmap, 0, BitsInfo->bmiHeader.biHeight, Bits,
@ -820,9 +824,14 @@ INT STDCALL NtGdiStretchDIBits(HDC hDC,
/* Origin for DIBitmap may be bottom left (positive biHeight) or top /* Origin for DIBitmap may be bottom left (positive biHeight) or top
left (negative biHeight) */ left (negative biHeight) */
NtGdiStretchBlt(hDC, XDest, YDest, DestWidth, DestHeight, if (SrcWidth == DestWidth && SrcHeight == DestHeight)
hdcMem, XSrc, abs(BitsInfo->bmiHeader.biHeight) - SrcHeight - YSrc, NtGdiBitBlt(hDC, XDest, YDest, DestWidth, DestHeight,
SrcWidth, SrcHeight, ROP); hdcMem, XSrc, abs(BitsInfo->bmiHeader.biHeight) - SrcHeight - YSrc,
ROP);
else
NtGdiStretchBlt(hDC, XDest, YDest, DestWidth, DestHeight,
hdcMem, XSrc, abs(BitsInfo->bmiHeader.biHeight) - SrcHeight - YSrc,
SrcWidth, SrcHeight, ROP);
NtGdiSelectObject(hdcMem, hOldBitmap); NtGdiSelectObject(hdcMem, hOldBitmap);
NtGdiDeleteDC(hdcMem); NtGdiDeleteDC(hdcMem);