From 5387b672a3f2f50718a70d007556de5e5453e33b Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Mon, 19 Sep 2005 14:31:32 +0000 Subject: [PATCH] Directly copy DIB bits into destination DC. --- dlls/mciavi32/mmoutput.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/dlls/mciavi32/mmoutput.c b/dlls/mciavi32/mmoutput.c index 6e074577b97..646d5079244 100644 --- a/dlls/mciavi32/mmoutput.c +++ b/dlls/mciavi32/mmoutput.c @@ -597,10 +597,8 @@ void MCIAVI_PlayAudioBlocks(WINE_MCIAVI* wma, unsigned nHdr, LPWAVEHDR waveHdr) LRESULT MCIAVI_PaintFrame(WINE_MCIAVI* wma, HDC hDC) { - void* pBitmapData = NULL; - LPBITMAPINFO pBitmapInfo = NULL; - HDC hdcMem; - HBITMAP hbmOld; + void* pBitmapData; + LPBITMAPINFO pBitmapInfo; int nWidth; int nHeight; @@ -619,7 +617,6 @@ LRESULT MCIAVI_PaintFrame(WINE_MCIAVI* wma, HDC hDC) mmioSeek(wma->hFile, wma->lpVideoIndex[wma->dwCurrVideoFrame].dwOffset, SEEK_SET); mmioRead(wma->hFile, wma->indata, wma->lpVideoIndex[wma->dwCurrVideoFrame].dwSize); - /* FIXME ? */ wma->inbih->biSizeImage = wma->lpVideoIndex[wma->dwCurrVideoFrame].dwSize; if (wma->hic && ICDecompress(wma->hic, 0, wma->inbih, wma->indata, @@ -647,21 +644,12 @@ LRESULT MCIAVI_PaintFrame(WINE_MCIAVI* wma, HDC hDC) nHeight = wma->inbih->biHeight; } - if (!wma->hbmFrame) - wma->hbmFrame = CreateCompatibleBitmap(hDC, nWidth, nHeight); + StretchDIBits(hDC, + wma->dest.left, wma->dest.top, + wma->dest.right - wma->dest.left, wma->dest.bottom - wma->dest.top, + wma->source.left, wma->source.top, + wma->source.right - wma->source.left, wma->source.bottom - wma->source.top, + pBitmapData, pBitmapInfo, DIB_RGB_COLORS, SRCCOPY); - SetDIBits(hDC, wma->hbmFrame, 0, nHeight, pBitmapData, pBitmapInfo, DIB_RGB_COLORS); - - hdcMem = CreateCompatibleDC(hDC); - hbmOld = SelectObject(hdcMem, wma->hbmFrame); - - StretchBlt(hDC, - wma->dest.left, wma->dest.top, wma->dest.right, wma->dest.bottom, - hdcMem, - wma->source.left, wma->source.top, wma->source.right, wma->source.bottom, - SRCCOPY); - - SelectObject(hdcMem, hbmOld); - DeleteDC(hdcMem); return TRUE; }