[cairo] drawing on and reusing an off-screen image surface

Peter Groves pdgroves at gmail.com
Mon Dec 3 15:02:04 PST 2007


On Mon, 03 Dec 2007 14:05:15 -0800
Carl Worth <cworth at cworth.org> wrote:



> So, if you're using X, then gdk_cairo_create will return a cairo_t*
> targeting an xlib surface, and cairo_surface_create_similar will also
> return an xlib surface. When you draw to this surface, the contents
> will be stored within the X server, (and might actually be stored
> within video memory on your graphics device). So drawing from this
> intermediate surface to the original surface, will generally perform
> much better than drawing from an image surface.

I nominate the above explanation for the faq! (If there is one.) In
retrospect, this is what I've been after the whole time.


> Make sense?
> 

Now it does. 

You've earned quite a few foss karma points today, Carl. Thanks.

After I get my app working, I'll try to summarize all this in a brief
tutorial and post it somewhere. I think this is a case
where the api's are correct and complete, but it's still difficult to 
see the big picture from them. Cairo has good high level overviews and
good api's, but it's still easy to get lost. I'm not sure if a manual or
a large faq or a bunch of tutorials would be most helpful in these 
situations. Regardless, I'll try to help out a little and write a how-to
on buffering cairo drawings for display in gtk applications.
This is just my observation from my first week of gtk and cairo, I'm not
trying to give anyone a hard time.

Peter
-- 
http://petergroves.com


More information about the cairo mailing list