[cairo] Path Gradients

Bobby Salazar bobby8934 at inbox.com
Tue Jan 8 09:42:05 PST 2008


> I would say that path gradients are still useless unless the path is
> very close to a circle. HOWEVER: the current Cairo radial gradient
> requires the path to be an ellipse, so this has a bit more power as
> those rounded rectangles are possible. Also they are trying to allow the
> same path object to be reused in useful ways to define both the pattern
> and the fill shape, although this seems to be leading to a bunch of
> extra fiddly controls such as the "bounding box", but still may be a
> good idea. I think otherwise there may have to be path transform
> operations added to Cairo.

I agree - path gradients with only a single center point are most useful for just near circular paths. However, I still think this is worthwhile to implement, and near circular paths would be IMHO the most commonly used.

> A gradient drawn between two paths could be much more useful as it could
> be used to produce the blobby effects on non-square shapes.

Yes, and this would be the more complex type of path gradients to support. If we started with a "simple" path gradient type that only accepted a single center point, we could later add the "complex" path gradient that took two paths. Perhaps at that time we could map the "simple" path gradient to the "complex" path gradient by supplying a path that has a single move_to() operation in it?


More information about the cairo mailing list