[Pixman] [PATCH] Improve handling of tangent circles

Andrea Canciani ranma42 at gmail.com
Fri Jan 14 07:30:52 PST 2011


On Fri, Jan 14, 2011 at 11:10 AM, Siarhei Siamashka
<siarhei.siamashka at gmail.com> wrote:
> On Wednesday 12 January 2011 23:58:55 Andrea Canciani wrote:
>> On Wed, Jan 12, 2011 at 6:36 PM, Andrea Canciani <ranma42 at gmail.com>
>> wrote:
>> > Attached is a patch which adds radial-test to the GTK pixman tests.
>> > I think we don't want it to be a checksum-based test because I believe
>> > we can tolerate minor differences (caused by different rounding modes
>> > or hardware where the float operations have slightly different error
>> > propagation), but the aspect should basically be independent of this.
>> >
>> > Please notice that the patch which started this thread changes the
>> > result
>> > of the test. Without it, the radial gradient can in some cases also
>> > include "negative radius" circles.
>>
>> I pushed the "Improve handling of tangent circles" patch to master.
>
> OK. Thanks.
>
>> Soren suggested some very useful improvements to radial-test, so
>> here is an updated patch, which checks for division by 0 and does
>> not use fmin/fmax.
>
> I think we are on the right track here. Thanks for the test program. A
> checksum-based test never was a requirement. I think it still would be
> nice to make a non-GTK variant of this test so that it could run
> automatically with 'make check' and also on http://tinderbox.x.org/
> So that they will come after us if we break something in the future ;)

Soren suggested extending composite, i.e. computing a "reference
gradient" in double precision with any algorithm and comparing its
results with those from the pixman implementation.
This might help with different fp implementations, but I'm afraid that
it would not solve the problem completely, unless the algorithm used
to compute the gradient is exactly the same.

Do you have any idea on what could be done to make such a test
more numerically stable? I've been thinking about blurring or things
like that, but I'm afraid that they would also miss off-by-ones and
other real bugs.

Andrea

PS: A simple non-gtk version of the test might be an interesting
addition to notice division by zero. Maybe it is appropriate for
gradient-crash-test.


More information about the Pixman mailing list