gdiplus: fix GdipFillRectangleI no effect on memoryDCwhosewindoworiginpoint has changed

Changhui Liu liuchanghui at linuxdeepin.com
Mon Dec 22 06:40:12 CST 2014


Hi, 


> I would prefer that you use the expect() macro when comparing integers in tests.
>
>If you don't expect a function (in this case GetDIBits, in patch 2) to
>fail when running a test, use ok() to check that it succeeded. It's OK
>if the test will crash when the ok() check fails.
>
>If GetDIBits really does fail sometimes, we need to understand why
>that happens and document it in the test.
>
>When writing comments about this, make sure you specify that you are
>talking about gdi32 device coordinates, which are different from
>gdiplus device coordinates.  


I have modified, please see the new patch file.


>+    status = GdipSetClipRectI(graphics, rect.left+width/2, rect.top+height/2,
>+            rect.right, rect.bottom, CombineModeReplace);
>
>This looks wrong to me. GdipSetClipRectI takes a width and height, not
>right and bottom.
The above statement is setting a clip range:
(rect.left+width/2, rect.top+height/2) - (rect.left+rect.right+width/2, rect.top+rect.bottom+height/2).
Because the rect is {100, 100, 180, 180}, so the clip range is: (140,140) - (320,320).
In fact GdipSetClipRectI can take any int value to specify a clip region.  
But according to your advice, I have changed to take a width and height .  


For helping review, I attached a BMP file which is the output of each test_GdipFillRectangle drawing on Memory DC.
Thank you.



------------------
Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20141222/22710581/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: memory_dc.bmp
Type: application/octet-stream
Size: 25654 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20141222/22710581/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gdiplus-fix-get_graphics_bounds-error-when-window-orig.txt
Type: application/octet-stream
Size: 3204 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20141222/22710581/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-gdiplus-fix-get_clip_hrgn-error-when-window-origin-poi.txt
Type: application/octet-stream
Size: 4882 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20141222/22710581/attachment-0006.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-gdiplus-fix-SOFTWARE_GdipFillRegion-no-effect-when-win.txt
Type: application/octet-stream
Size: 10158 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20141222/22710581/attachment-0007.obj>


More information about the wine-devel mailing list