[cairo] path gradients and cairo
vladimir at pobox.com
Fri Apr 23 22:48:28 PDT 2004
In implementing some bits of GDI+ on top of Cairo for Mono's Drawing
stuff, I'm looking for a way to implement GDI+'s notion of a "Path
Gradient". What this is is an array of points, each with an associated
color, and a center point and center color. The gradient is rendered by
rendering triangles using two adjacent points on the path and the
center point, smoothly interpolating between the 3 colors --
essentially, Gouraud shading across the triangle, repeated for every 2
adjacent points on the path and the center point.
I'm thinking about trying to implement this in cairo, as a new pattern
type. Are there any pitfalls that I should be aware of in doing so?
Also, even though this is probably going to be a rarely-used pattern
type, it can get easily hardware accelerated with the opengl back end.
Is there any way to pass that kind of pattern data down to glitz, so
that it can just render shaded triangles?
More information about the cairo