Some notes on optimization work in progress (was: Re: [cairo] WinXp benchmarks)

David Reveman davidr at novell.com
Tue Mar 8 05:48:31 PST 2005


On Fri, 2005-03-04 at 22:42 +0100, Soeren Sandmann wrote: 
> David Reveman <davidr at novell.com> writes:
> 
> > > I haven't actually written the code and tried it, so I could be wrong
> > > of course.
> > > 
> > > (Why is it that we can't use the GPU shader for this?)
> > 
> > Oh, we can, the glitz backend is doing almost every gradient supported
> > by cairo using shaders, if hardware supports it of course. But there's a
> > lot of hardware that doesn't support shaders and a fast software
> > implementation is always useful. 
> > 
> > I can easily accelerate simple 2-stop linear gradients on hardware
> > without shader support in the glitz backend, just haven't got around
> > doing that yet.
> 
> Actually what I meant was: Can't we take a gradient pattern and break
> it down into a number of triangles, then compute the desired color at
> each corner of the triangle, then use the hardware to interpolate?
> Even old hardware should be able to that, right?

Yes, that would work with old hardware. 

The gradient stuff I've got in glitz right now will be replaced by
something more appropriate. Just not sure by what yet. I don't think
triangles and interpolation between corners is going to give us good
enough quality for most gradients, even with a huge number of triangles.
For simple gradients it should work fine and be very efficient so it
might be worth supporting that anyway...

-David




More information about the cairo mailing list