[Pixman] [cairo] Radial gradient definition for cairo?
sandmann at daimi.au.dk
Tue Mar 2 03:08:41 PST 2010
M Joonas Pihlaja <jpihlaja at cc.helsinki.fi> writes:
> I was looking at bug 5681 today and wondering what exactly the problem
> there is. The bug report contains a test program which draws a radial
> gradient as well as some screen shots of radial gradients rendering
> differently in cairo 1.0.2 and then-current cvs head. It turns out
> that the test case in the bug report has the inner circle outside the
> outer circle, so the focal point is way outside the outer circle too.
> On the pixman mailing list Siarhei Siamashka noted that neither
> Xrender nor SVG support radial gradients where the focal point is
> outside the outer circle:
Gradients were originally added to XRender in 2005. The discussion of
that is here:
The original Render code did not support the case where the inner
circle was not contained within the outer, but it did not actually
produce BadValue as the spec claims.
This gradient code was imported into cairo, and the 1.0.2 screenshot
in bug 5681 is what happened if the inner circle wasn't contained in
This thread from 2007:
discusses how radial gradients are supposed to be defined, including
what it means when one of the circles are outside the other, and which
of the circles is the 'first' one. Carl then fixed the implementation
and added the long comment to fbcompose.c that now lives in
pixman-radial-gradient.c. When the X server started using the same
code as cairo, it gained the ability to deal with disjoint circles too.
Half a year ago or so, Chris fixed a bug in the radial gradients in pixman:
with this commit
that implicitly imposed an interpretation on gradients. I'm not 100%
convinced that interpretation agrees with the outcome of the first
thread. (I'm not sure it doesn't either).
I haven't actually read all the threads above (not recently anyway),
so I don't really have much of an opinion of my own on what radial
gradients should do.
More information about the Pixman