[PATCH 0/2] gdiplus: Small DrawImage() resampling fixes.

Jan Havran havran.jan at email.cz
Sun Mar 24 17:28:18 CDT 2019


On 24. 03. 19 16:54, Nikolay Sivov wrote:
> On Sun, Mar 24, 2019 at 5:49 PM Jan Havran <havran.jan at email.cz> wrote:
>
>> Hello Wine community, this is my first Wine patch.
>>
>> This series fixes some drawing of GDI+ DrawImage() where resampling was
>> applied.
>> I tried to write some unit tests, but it turned out that there is no simple
>> and effective way how to catch all differences between native gdiplus
>> library
>> and Wine lib (without putting significant part of DrawImage() into tests
>> file).
>> At least I wrote relative complex standalone tests for my own testing where
>> I was comparing every pixel drawn by buildin and native lib, and I am
>> pretty sure this series fixes mentioned issues without breaking anything
>> else.
>>
>> There are much more drawing issues I noticed so far, but for some I do not
>> know to
>> fix them without breaking other stuff, for some issues I know what caused
>> them, but
>> I do not know how to fix them, and for some for I have no idea why are
>> they appearing.
>> But I will keep testing.
>>
>> Jan Havran (2):
>>    gdiplus: Fix rounding dst_area borders for GdipDrawImagePointsRect().
>>    gdiplus: Fix resample offset for nearest neighbor interpolation.
>>
>>   dlls/gdiplus/graphics.c | 46 ++++++++++++++++++++++++++++++++++-------
>>   1 file changed, 38 insertions(+), 8 deletions(-)
>>
> Hi, Jan.
>
> Could you open a bug report for that, and attach before/after images there
> that show artifacts?


Hi Nikolay,

sure I can.

It seems like (according to the bot results) I somehow missed related tests in 
image.c - my fault, but honestly I expected DrawImage tests in graphics.c, 
where is other DrawImage stuff (my initial understanding was that each file in 
tests folder is focused on testing implementation of related file in gdiplus 
folder... anyway I should run all tests next time).

I need to do more investigation. My scale tests were based on calling 
GdipDrawImagePointsRect with different values in points array (doing the 
scale), while test in image.c is doing scale by changing world matrix. 
Interesting thing is that these ways give same results in buildin gdiplus, 
while it differs in native lib (I have to verify it).

Tests in image.c showed me the way how to write tests for DrawImage, so I will 
try to cover my patches by these kind of tests next time.

I was pretty sure that I isolated the issues and fixed them without breaking 
other stuff, but it seems to be more complex than I thought. At least the 
second patch seems to be ok...




More information about the wine-devel mailing list