[Pixman] [PATCH 0/5] Improved precision in gradient walker

Søren Sandmann sandmann at cs.au.dk
Fri Mar 8 15:01:51 PST 2013


Hi,

The following patches improve the precision of
pixman-gradient-walker.c while keeping performance more or less the
same by using a more efficent interpolation formula (essentially
turning the whole computation into a single

	s * x + b

for each channel avoiding the per-pixel computation of the distances
to the left and right color stops). In total, the total amount of
computation is about the same as before when you take into account
that the new formula requires enough precision that it can't easily be
used in a SIMD-within-a-register fashion. There is a detailed
explanation in patch 5/5.

The improvement in appearance is very noticable:

    http://people.freedesktop.org/~sandmann/gradients/before.png
    http://people.freedesktop.org/~sandmann/gradients/after.png

A potential concern is that the new implementation uses floating point
instead of integer arithmetic. On x86 the performance impact is very
small, but it could potentially be bigger on other systems, although
it should be pointed out that we already rely on floating point for
all three types of gradients.

The performance changes were measured with a new microbenchmark
radial-perf-test in the test directory, and the gradient in the images
above were rendered by a new demo program called linear-gradient.


Soren




More information about the Pixman mailing list