Fix for PlgBlt, the XFORM matrix was calculated incorrectly

Alexander Almaleh sashoalm at gmail.com
Wed Jun 11 04:36:16 CDT 2014


Hi Michael,

I just realized that it would be impossible to write an automated test for
PlgBlt now, because Wine has a second, unrelated but, for which I already
wrote another email to wine-devel. It's titled "BitBlt doesn't honor the
rotation specified by SetWorldTransform". So even with my fixed PlgBlt,
Wine's version would still not work correctly, until that second, unrelated
bug is fix. That's why I submitted a Windows project where I compare my
patched PlgBlt, and Wine's PlgBlt under Windows.

Bearing that in mind, what is your advice? Bruno Jesus already wrote that
he can confirm my code runs in Windows. Should I just explain how I reached
the formula for the XFORM matrix?



On Tue, May 27, 2014 at 11:40 PM, Alexander Almaleh <sashoalm at gmail.com>
wrote:

> Ok. Btw, I have some other things on my head now, so it might be a week or
> two before I come back to this.
>
>
> On Fri, May 23, 2014 at 1:35 AM, Michael Mc Donnell <michael at mcdonnell.dk>
> wrote:
>
>> Hi Alexander
>>
>> On Thu, May 22, 2014 at 2:25 AM, Alexander Almaleh <sashoalm at gmail.com>
>> wrote:
>>>
>>> OK, I'll try to write a unit test. I found this tutorial -
>>> https://www.winehq.org/docs/winedev-guide/testing, is it the correct
>>> thing to read?
>>>
>>
>> Yes that is the correct thing to read.
>>
>>
>>>   You might be able to get your patch in without the automated test,
>>>> but I think you need to explain clearly what was wrong with the old code
>>>> and what you are doing instead. A few more simplified examples that test
>>>> other cases in your bug report might also help.
>>>>
>>>
>>> The trouble is I don't quite remember the exact steps I took 5 years ago
>>> to come up with the new formula. However, I do remember I came up to it by
>>> solving a system of linear equations. Since XFORM matrix is applied to each
>>> point, I took 3-4 measurements of how points are transformed by PlgBlt, and
>>> then used that to make equations of the type applyXFORM(xSrc) = xDest. By
>>> solving the equations for the XFORM matrix, I came up with the correct
>>> formula I need to get the XFORM matrix from the input variables. I used an
>>> online linear equation solver, so there's no human error.
>>>
>>> I'll try to recreate the steps, maybe it'll be easier to just explain
>>> them. I'll look into making automated tests, too.
>>>
>>
>> Sounds good. Like you are saying, figuring out the formulas again would
>> be a good idea. The current code does not explain where the formulas are
>> coming from. Adding that as comments in your patch would make it easier to
>> verify than the current code.
>>
>> Michael
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20140611/e72618e5/attachment.html>


More information about the wine-devel mailing list