[cairo] drawlist type functionality?

Pete Shinners pete at shinners.org
Fri Apr 1 18:41:37 PST 2005


Excuse my general newness to Cairo itself, although I've been lurking the
mailing list for several weeks. I am interested in using cairo from the Python
end, and have some thoughts.

I code a function to draw a semi-complex shape and call it repeatedly to render.
I am going to take a considerable performance hit since the drawing code comes
from Python. There are two solutions that would be interesting to me.

First would be a drawlist functionality similar to opengl. This is where you
"record" a batch of gl operations into a single drawlist. The drawlist can then
be "replayed" with a single call. The drawlists can do just about anything to
the gl context.

Another approach would be a simple 'render description' object that would encode
a batch of cairo operations into a single object. It would be a stream of tokens
and values that get translated into cairo calls.

At first I would think the drawlist method is cleaner. But I am wondering if
this could provide performance benefits beyond a tight loop accessing the cairo
C api? Has this type of feature been discussed before? It would seem wise to
allow the render backends to manage the call lists if they think they can do a
better job than a default implementation.

Cairo seems like an interesting project to me. I wonder if fleshing this out
further would be the type of thing to pull me in?





More information about the cairo mailing list