[cairo] Re: "retained" surface for cairo

Carl Worth cworth at east.isi.edu
Tue Jul 20 09:19:38 PDT 2004

On Tue, 20 Jul 2004 18:02:33 +0200, Jost Boekemeier wrote:
> But I want to keep the whole picture that the user has created.  For
> example if I give him a cairo_t and he creates a 1000x1000 scene using
> the cairo API, then I need a way to do different transformations to this
> scene without destroying the scene graph.

OK, so you do want a retained-mode interface, just as you said in your
subject[*]. If you begin the thought experiment, you'll quickly see that
for this you'll need a fair amount of new API beyond just a new type of
surface. And people that have a lot more experience than me have made a
compelling argument that the best way to implement that new interface is
as a separate layer on top of a clean immediate-mode interface, like
we're trying to create in cairo.

> Of course, you can argue that cairo is not meant for animatable scene
> graphs, like scrolling windows, and that the graph should be maintained
> on a level above cairo. This would not be a problem for us, because we
> do not expose cairo_t to the users (they create XUL/SVG scenes).

Yes, you predicted the argument quite well. We're optimistic that there
won't be any insurmountable performance problems due to the separation
of the immediate- and retained-mode interfaces. But, we are looking
forward to seeing more implemntation on top of cairo to prove the point
or show us where we need to augment the API.

So, please, keep working with cairo and feel free to implement what you
want on top of it. And keep us posted here on your progress. I certainly
wouldn't be disappointed to see a de-facto standard retained-mode
interface get developed that could be used generally, (eg. in multiple
toolkits), a "cairo canvas" if you will.


[*] I was thrown off a bit by your proposal for client-side
tranformation of geometry. All geometry transformation in cairo is
client-side. The backends (such as Render) do not even accept a
transformation for the geometry.

More information about the cairo mailing list