On Tue, Jan 4, 2011 at 11:12 AM, Andrea Canciani <[email protected]> wrote: > On Tue, Jan 4, 2011 at 10:59 AM, Siarhei Siamashka > <[email protected]> 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 >>> black. >>> >>> 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 >> tests? > > It is triggered by the new radial-gradient tests in cairo: > http://cgit.freedesktop.org/cairo/commit/?id=ada6057b8ccab133909b127850c41abb3216a842 > > 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 >> have >> at least some basic tests which can catch possible errors and regressions. > > 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. Andrea
0002-Add-a-test-for-radial-gradients.patch
Description: Binary data
_______________________________________________ Pixman mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/pixman
