[cairo] Clip region problems

Owen Taylor otaylor at redhat.com
Wed Apr 27 09:31:39 PDT 2005


On Wed, 2005-04-27 at 11:33 -0400, Owen Taylor wrote:

> >  4. Only allow a surface to be used for a single thing at a same time
> > 
> >      - two cairo_t's cannot be active for the same target surface
> >      - a surface that is the target of a cairo_t cannot be used
> >        as a source.
> > 
> >     Pro: Simple
> >     Con: Fairly big restriction
> 
> Would it be OK if I implemented this for now? Leaked clips are
> biting me a lot in GTK+. 
> 
> We can always relax the restriction later.

Thinking about this some more, I'm not totally happy with this
restriction ... it's going to cause code like:
 
 cr = gdk_drawable_create_cairo_context (d);

 /* ... draw with cairo ... */

 gtk_paint_flat_box (widget, d, ...);

 /* ... more drawing with cairo ... */

 cairo_destroy (cr);

To fail. So perhaps a less restrictive version is to require creation
and use of cairo_t's for one cairo-surface to be nested. This can
be implemented with a simple stack of saved clip regions.

Regards,
					Owen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050427/922774ca/attachment.pgp


More information about the cairo mailing list