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

Carl Worth cworth at cworth.org
Mon Dec 3 11:06:06 PST 2007


On Mon, 3 Dec 2007 12:31:58 -0600, Peter Groves wrote:
> So what I'm hearing is that manipulations with raster data are typically
> best done on the gtk side. Is this a safe generalization to live by?

I'm not sure what you mean by "gtk side" at all. You should definitely
feel free to use cairo for any operation it can perform.

> I ask b/c next I'll be drawing small glyphs with cairo and then making a
> few hundred copies of each to make a large data plot, and was going to use this
> same basic idea (draw to an image, then copy the image onto the background).

Yes, that's a fine idea. And you can use cairo to do that.

In cairo terms, I'd rephrase your approach as "draw to a surface, then
copy the surface", and then recommend that for this intermediate
surface you should use a "similar" surface rather than an "image"
surface for better performance.

And that is a good generalization. A similar surface should be
preferred unless an image surface is actually required, (which should
only be required if you need to do direct, non-cairo manipulation of
the image data).

Does that make any more sense?

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20071203/9ff1c8a4/attachment.pgp 


More information about the cairo mailing list