[cairo] Clipping To Gdk Region

Andrew Johnson acjgenius at earthlink.net
Mon May 3 10:42:45 PDT 2004


On Mon, 2004-05-03 at 06:28, Carl Worth wrote:
> On Fri, 30 Apr 2004 15:20:14 -0400, Andrew Johnson wrote:
> > I can get the rectangles via gdk_region_get_rectangles, however I cannot
> > see any fast and easy way to apply this directly to the surface. If I
> > had the xrender handle actually being used I could simply create a new
> > xregion and apply it, then free on done, but I am not seeing anyway to
> > handle this in the current api. 
> 
> You should have the Xlib handle for the Drawable of the target, since
> you had to have that to create the cairo surface. Does it give you what
> you need?
> 

not completely.

> The current API hides the fact that a Render Picture is used, but we can
> add an API to create a cairo surface from a Picture rather than a
> Drawable if that is necessary.
> 

That would actually be a good solution. I think I could easily handle
this so long as I am able to manage the render picture myself.

> We have also discussed adding a cairo API to clip surface output to a
> list of rectangles, (most likely specified as a pixman_region_t). But we
> didn't have consensus on a clean API for this.
> 

Yeah, that would be the ideal solution for cross device output long
term.

> Finally, in the meantime, Graydon Hoare has added code to cairo_clip to
> automatically detect rectangles in the path and implement them via
> direct clipping on the underlying surface (eg. the Drawable). So, you
> may be able to get some of what you want that way, (although that would
> require a useless conversion from device space coodinates to user space
> and then back again).
> 

huh. Ok, I will look and see how hard this will be to use.

Andrew





More information about the cairo mailing list