[cairo] Re: cairo gradients

Carl Worth cworth at cworth.org
Tue Apr 18 09:33:17 PDT 2006

On Tue, 18 Apr 2006 11:00:21 +0100, Jonathan Watt wrote:
> David Reveman wrote:
> > For the pixman backend, X server backend and glitz backend the results
> > are undefined when some part of the inner circle is outside the outer
> > circle. In general cairo tries to expose as few cases as possible that
> > can result in undefined results

Yes, cairo definitely does want to avoid undefined behavior.

I didn't realize that that was what we got when the smaller circle
intersects or is outside the larger circle.

There shouldn't be any requirement for undefined behavior here. For
example, PDF provides a two-circle specification of a radial gradient
and carefully defines the result when one circle does not entirely
containt the other, (giving the appearance of inward-pointing cone if
the first circle is smaller and an outward-pointing code if the first
circle is larger).

The PDF semantics seem quite reasonable to me. So if someone wants to
fix things, I don't see why we wouldn't follow that. We can put the
new implementation into libpixman and avoid X server gradients when
they are not compatible, (currently cairo is always avoiding X server

One thing we really need here is some test cases for the test
suite. We also need to carefully characterize which versions of which
X servers can be relied upon to do server-side gradients, (David
provided a patch for server-side gradients in the past, but it hasn't
been applied yet---he originally said it shouldn't be applied as X
servers at the time were crashing when server-side gradients were

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060418/11e41ff6/attachment.pgp

More information about the cairo mailing list