[cairo] cairo/gdk + clipping

Benjamin Otte otte at redhat.com
Thu Aug 19 02:07:52 PDT 2010


On Thu, 2010-08-19 at 18:51 +1000, Andrew Cowie wrote:
> On Wed, 2010-08-18 at 15:49 +0200, Benjamin Otte wrote:
> > So if you render everything with Cairo, what you usually want to for
> > creating your Cairo context is run code like this:
> > 
> > cr = gdk_cairo_create (event->window);
> > gdk_cairo_region (cr, event->region);
> > cairo_clip (cr);
> > 
> > Then you end up with a region that is properly clipped...
> 
> I thought GdkRegion was deprecated?
> 
It is, but gdk_cairo_region() isn't. It's one of GDK's utility functions
that has no equivalent in cairo. The positive side effect is that this
code compiles fine in GTK2 and GTK 3.

Benjamin



More information about the cairo mailing list