[cairo] clipping question

Fabien Costantini fab672000 at yahoo.fr
Tue Jun 27 08:52:23 PDT 2006


But using cairo_save/restore api would save the _whole_ context,
and I only need to deal with the clipping context.
Furthermore, restoring other undesired context attributes would have side effects on the drawings,
so I'm afraid it's not usable in my situation.

Fabien

----- Message d'origine ----
De : Emmanuel Pacaud <emmanuel.pacaud at univ-poitiers.fr>
À : Fabien Costantini <fab672000 at yahoo.fr>
Cc : Cairo List <cairo at cairographics.org>
Envoyé le : Mardi, 27 Juin 2006, 5h44mn 15s
Objet : Re: [cairo] clipping question

Le mardi 27 juin 2006 à 15:25 +0000, Fabien Costantini a écrit :
> Hi,
> I would like to push and pop clipping rectangular surfaces in a given context.
> 
> For the rectangle clip accumulation,
> I suppose I must use 
> cairo_clip(), then cairo_clip_preserve() 
> 
> But then If i want to remove the latest rectangle i accumulated 
> with  cairo_clip_preserve() what am i supposed to do ?
> If I use cairo_reset_clip() I remove all clipping.
> 
> Is there an api permitting to keep track of clipping states 
> so that I could restore my previous state to implement the pop_clip functionnality ?
> 
> Otherwise, I could achieve this functionnality by first calling cairo_reset_clip() 
> then 'replay' all clips surfaces but I'm afraid it will be time consuming.

Use cairo_save/cairo_restore, like explained in cairo documentation :)

    Emmanuel.






More information about the cairo mailing list