[cairo] RFC: duplicating, storing and serializing drawing operations

chris nuernberger cnuernber at gmail.com
Tue Dec 26 12:34:39 PST 2006

This is an awesome thread.  I am really glad someone is bringing this up.

How much information does cairo give to the back end?  Could you have
a meta-backend that could sit between the user and one or more real

If you could, then you have your system right there for a lot of this.

Now I imagine the backend stores specific information on the cairo
datastructures to do several things, so the meta-backend would
probably need a way to clone each cairo user-level datastructure it
sees.  I have no idea how difficult this would be to do bug-free, but
it is certainly something you could test fairly easily (assuming you
wrote an '==' operation for every object at the same time you were
writing the 'copy' operation).  Then if you had a way to serialize the
user level datastructures, you could do the "printf" like stuff, as
well as store the specific cairo image to a file for something later.
The ongoing maintenance of this sort of thing gets to be a real PITA
over time, though.

Anything that automates making cairo bindings in other languages
should have a decent shot at getting all this working pretty well
almost automatically, as it could perhaps automatically generate the
clone and equals operations.  Then your maintenance burden drops
dramatically, although your initial testing burden is still decent.

Getting all this set up means you are almost all the way to getting a
cairo-diff operation working.  That would be sweet for a few reasons,
although now I am getting a little crazy.

About the earlier part, the simple drawing stuff without an event
loop.  I think it really kicks ass.  I just don't know enough about
windowing systems to comment in general.

I probably don't know enough about this problem to comment either, it
(or my perception of it) just sounds interesting...


More information about the cairo mailing list