[cairo] path gradients and cairo

Carl Worth cworth at east.isi.edu
Thu Apr 29 04:05:38 PDT 2004


On Fri, 23 Apr 2004 22:48:28 -0700, Vladimir Vukicevic wrote:
> 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".
[...]
> 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?

We've already got two common gradients, (linear and radial). I view
these as special cases of a general gradient. And I think that all we're
missing is a way of expressing that general gradient.

It doesn't sound to me like the "path gradient" is totally general. And
if not, I definitely don't wat to add a rarely-used special case.

There are probably lots of ways to specify the general gradient, and we
should be able to implement almost anything in software. So my thought
is that we should be guided by what is natural for the underlying hardware.

I imagine OpenGL allows a mesh of colored triangles, right? Is there any
reason we shouldn't just use that?

-Carl





More information about the cairo mailing list