[Pixman] [PATCH] Improve handling of tangent circles
ranma42 at gmail.com
Wed Jan 12 13:58:55 PST 2011
On Wed, Jan 12, 2011 at 6:36 PM, Andrea Canciani <ranma42 at gmail.com> wrote:
> On Tue, Jan 4, 2011 at 11:12 AM, Andrea Canciani <ranma42 at gmail.com> wrote:
>> On Tue, Jan 4, 2011 at 10:59 AM, Siarhei Siamashka
>> <siarhei.siamashka at gmail.com> wrote:
>>> On Monday 03 January 2011 10:15:09 Andrea Canciani wrote:
>>>> When b is 0, avoid the division by zero and just return transparent
>>>> When the solution t would have an invalid radius (negative or outside
>>>> [0,1] for none-extended gradients), return transparent black.
>>> Thanks for keeping improving radial gradients code.
>>> I just wonder if it would be difficult to add a test to pixman for this
>>> particular division by zero case? Or is it somehow triggered by cairo
>> It is triggered by the new radial-gradient tests in cairo:
>> The refimages have been created with a patched pixman, so the tests
>> currently fail on cairo-image, but would pass with this change.
>>> One of the problems with the pixman radial code is that it is slow.
>>> And this path further slows it down a bit by adding a new branch in the
>>> inner loop. This is perfectly fine for a reference implementation, but if
>>> somebody decides to add some performance optimizations, then we need to
>>> at least some basic tests which can catch possible errors and
>> I plan to rewrite the radial-gradient test to make it only use pixman
>> so that it can be added to pixman testsuite.
> 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.
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 7007 bytes
Desc: not available
More information about the Pixman