[cairo] drawlist type functionality in Cairo

David Reveman davidr at novell.com
Tue Apr 5 07:13:31 PDT 2005

Here's my thoughts on drawlist type functionality in Cairo.

Using OpenGL display lists with cairo is not a good idea. Cairo requires
rasterization to intermediate buffers and either we use software
rasterization, pbuffers and CopyTexSubImage or framebuffer objects this
can't be compiled into a display list. Glitz is not designed to use
display lists, display lists are memory inefficient and not what we want
to use. 

What we should be using are vertex arrays and VBOs. Glitz already
support this perfectly, we just need to make cairo utilize it.

I don't think we need a cairo display list or similar at all.

I think it's all about caching. An application that likes to use a
pattern more than once shouldn't create a new pattern every time. It
should create the pattern once, keep a reference to it and use it
whenever it likes. Backends can be smart and cache this pattern in
appropriate form. e.g. if you'd create a pattern from an image surface
and use it draw onto a glitz surface the glitz backend would cache a
glitz surface in this pattern.

The same thing applies for paths. If we allow the application to keep a
reference to a cairo unscaled path, backends would be able to cache
these path objects as they like. Glitz backend could keep all vertex
data in a static VBO for optimal performance.

All we would need in the API is an opaque type for an unscaled path and
possibly some usage hints which could be used for optionally telling the
backends how to cache a path or a pattern.


More information about the cairo mailing list