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

Soeren Sandmann sandmann at daimi.au.dk
Thu Mar 3 15:46:10 PST 2005


David Reveman <davidr at novell.com> writes:

> Either way it seems like the gradient calculations are quite expensive.
> The first thing we should do is check that no larger gradients than
> necessary are created, after the recent changes that made so that
> patterns are passed to the backends, I'm no longer sure that the size is
> optimal. The second thing we could do is to hook up simple optimizations
> for vertical and horizontal gradients as Owen suggested recently.

Even for non-axis aligned gradients, we should be able to do better:

  For each line of pixels compute the relevant color stops and their
  positions, then for each sub-gradient just do a simple linear
  interpolation using a floating point factor. 

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?)

> Looking at gearflowers.svg and SVGs in general, it seems that most
> patterns are solid or gradients and that should always end in this
> composite operation:
> 
> SRC(argb32, no transform) in MASK(a8 shape, no transform) op
> DST(probably ARGB32 or 32bpp RGB24)
> 
> We should be able to accelerate that pretty well, right?

Yeah.


Søren



More information about the cairo mailing list