Patch to properly bitBlt() masked pixmaps

Ryan Rusaw rrusaw at sasktel.net
Thu Dec 16 02:07:39 CET 2004


Chris,

Attached is the patch in unified format to qpaintdevice_win.cpp

Ryan

>Do you mind sending a unified patch instead (diff -u)? They are easier to
>apply and less sensitive to other changes in the code. Also please include
>an indication of which file the patch is against (I assume qpainter_win.cpp
>in this case?)
>
>Thanks,
>Chris
>
>  
>
>>Below is a patch that reverts an incorrect fix I submitted 
>>through the bug tracker last month in regards to improper 
>>masked bitBlt()'s and then fixes it in the correct manner. My 
>>first patch, in error, ignored the Qt::RasterOp passed to bitBlt().
>>
>>Explanation:
>>The original call to CreateCompatibleBitmap() was on the 
>>newly created in-memory temporary DC (hTmpDC) and as such 
>>always returns the 1x1 monochrome bitmap that is by default 
>>selected into it. 
>>CreateCompatibleBitmap() should be called on the original device
>>(dsthandle) instead.
>>
>>Sorry about the previous error.
>>
>>Ryan
>>
>>921c921,927
>><         BitBlt( dsthandle, dx, dy, sw, sh, srchandle, sx, 
>>sy, SRCINVERT );
>>---
>> >         HDC hTmpDC = CreateCompatibleDC( dsthandle );
>> >         HBITMAP hTmpBmp = CreateCompatibleBitmap( 
>>dsthandle, sw, sh );
>> >
>> >         HBITMAP hOldBmp1 = ( HBITMAP ) SelectObject( 
>>hTmpDC, hTmpBmp );
>> >         BitBlt( hTmpDC, 0, 0, sw, sh, srchandle, sx, sy, ropCodes[ 
>>rop ] );
>> >
>> >         BitBlt( dsthandle, dx, dy, sw, sh, hTmpDC, 0, 0, 
>>SRCINVERT );
>>923c929,933
>><         BitBlt( dsthandle, dx, dy, sw, sh, srchandle, sx, 
>>sy, SRCINVERT );
>>---
>> >         BitBlt( dsthandle, dx, dy, sw, sh, hTmpDC, 0, 0, 
>>SRCINVERT );
>> >
>> >         SelectObject( hTmpDC, hOldBmp1 );
>> >         DeleteObject( hTmpBmp );
>> >         DeleteDC( hTmpDC );
>>
>>
>>_______________________________________________
>>kde-cygwin mailing list
>>kde-cygwin at kde.org
>>https://mail.kde.org/mailman/listinfo/kde-cygwin
>>
>>    
>>
>
>_______________________________________________
>kde-cygwin mailing list
>kde-cygwin at kde.org
>https://mail.kde.org/mailman/listinfo/kde-cygwin
>  
>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: qpaintdevice_win.cpp.patch
Url: http://mail.kde.org/pipermail/kde-cygwin/attachments/20041215/03ef20c4/qpaintdevice_win.cpp.cc


More information about the kde-cygwin mailing list