[cairo] Re: drawlist type functionality?

Pete Shinners pete at shinners.org
Sun Apr 3 16:18:27 PDT 2005

On Sun, 2005-04-03 at 10:07 -0400, Mike Emmel wrote:
> I'm not convinced it makes sense to replicate the direct drawing api
> of cairo for a drawlist engine I'm not saying they won't be similar
> but I'm not sure you can hide the engine behind the cairo api.
> If your serious about this I'm extremely intrested :)

I've got to study up on the Cairo API a bit more, although I see it's
getting some good reorganization at the moment.

I'm curious to see what sort of data is temporarily created as the
drawing calls are made. In the future it could be spectacular to save
these structures and recycle them on repeated calls. Although I'm not
certain this is entirely possible since the Cairo context can be
configured for just about anything before the drawlist is called. These
are also likely backend specific.

I was thinking the drawlists could be recorded as a custom backend.
Again, I want to get more comfortable with the API before getting into
this. Coming from the python end..

        # create a "bowtie" context
        ctx = cairo.Context()
        drawlist = cairo.Drawlist()
        ctx.move_to(0, 0)
        ctx.line_to(1, 1)
        ctx.line_to(1, 0)
        ctx.line_to(0, 1)

This might be simpler to implement than the way OpenGL does things. In
OpenGL while the drawlist is "recording" all of the opengl calls are
sort of intercepted.

More information about the cairo mailing list