[Cairo] Generic memory/speed efficient surfaces?
andrew.chant at utoronto.ca
Mon Nov 24 20:56:08 PST 2003
Chances are there's already a solution to this that I am unaware of,
but I have read what I can find and I'm still not sure. I am curious if there is a generic surface which can be created, then used for drawing and then eventually applied to a 'real' surface with 'cairo_show_surface'. It would have the user-space co-ordinate system as its own device coordinate system, and allow control over precision.
My motivation for this is wanting to make sort of virtual pixmaps
within cairo, for use with my Xlib app. I don't want to use real
pixmaps, because it adds unnecessary communication with the X server and because (I may be wrong here) it will pixelize the image before cairo_show_surface. It could also make double-buffering a lot easier, with Xlib.
For example, you could render your whole window on the fast, memory
efficient generic back end, then do one great XCopyArea to the window,
rather than Cairo doing X operations on a pixmap, then having that
pixmap be XCopyArea'd to the window.
I think using a postscript surface may be the solution, but I'm not
ps, check out the game of life demo. I've been hacking it in my spare
time and its looking a lot better lately.
More information about the cairo