[cairo] cairo internal design ideas

David Reveman c99drn at cs.umu.se
Wed Sep 22 20:21:56 PDT 2004


On Wed, 2004-09-22 at 21:52 +0200, Jost Boekemeier wrote: 
> 
> > 2. The software fall-back path for patterns is
> > messed up right now. 
> 
> How is that related to your suggestion to make the
> backends independent of the tesselator?

It's not, sorry if it could be understood that way.

Passing cairo_pattern_t object pointers to the surface backends draw
function is related to this. Using a pattern to create a source surface
for a specific backend and then use that source surface for drawing
means that in case of a software fall-back in the drawing operation, we
need to convert this source surface, created for a specific backend into
an image surface that represents the original pattern and that's a lot
of trouble for the backend. 

When passing cairo_pattern_t pointers to the backend drawing function,
this wouldn't be a problem.

> 
> > 3. Clipping is inflexible and the way it's done
> > right now is not efficient for all backends.
> 
> Probably.  But I don't see how your suggestion would
> help to improve this.

An SVG backend would probably like to just throw out something like
this:
<clipPath id="MyClip">
<path d="..." clip-rule="evenodd" />
</clipPath>
<rect clip-path="url(#MyClip)" ... />

and PDF has clipping paths that work in pretty much the same way.

for pixman, xrender and glitz backends I'd like to see clipping at the
tessellation level but that would of course work fine with the current
surface backend interface as well.

> 
> 
> > [cairo] should push high
> > level objects to the backends and the backends
> > should be able request
> > appropriate representation of these objects.
> 
> I don't think this is necessary.  -- Well, it depends
> on what exactly you mean with "high level objects". 
> Probably not a GObject, and not a shape, either.  The
> only thing you can pass down is the path.  But what
> would this be good for?  Should all backends implement
> their own tesselator?

high level objects = path

cairo would provide a tessellator, any backend that like to tessellate a
path to trapezoids would probably like to use that one.
 
-David




More information about the cairo mailing list