[cairo] cairo internal design ideas

Bill Spitzak spitzak at d2.com
Thu Sep 23 12:29:30 PDT 2004

On Wednesday 22 September 2004 08:41 pm, David Reveman wrote:
> A better solution would be to do the clipping in software and just send
> one set of trapezoid primitives to hardware. So how do we do this? Well,
> to me, the tessellator is basically doing clipping. If we could get the
> tessellator to do all clipping (we send it a drawing path and a clipping
> path and it returns one set of trapezoids) that would be perfect. Do you
> think this is possible?

I wish, I suggested this a long time ago. Unfortunatly the set of compositing 
operators include ones which modify outside the path, so you cannot reduce 
the clip+path to a single path.

My suggestion was:

1. get rid of all operators that can modify a pixel outside the path (or when 
the alpha is zero in a source pattern).

2. Add a "invert path" operator that makes the "interior" of the path be 
everything outside it, rather than inside it.

The purpose is so that the backend can think about a single alpha channel 
rather than two, thus removing one term from all the compositing functions. 
It would also allow path+clip to be turned into a single path.

Maybe it should be brought up again. I serioulsly doubt any actual 
application needs the Porter-Duff compositing operators that modify the 
outside area, and besides you can emulate those with the invert-path (full 
emulation also requires inverting a source image's alpha, but I suspect it is 
not needed).

Invert-path is also vital in order to "clip out" a shape, which is currenlty 
impossible in the current Cairo scheme.

More information about the cairo mailing list