[cairo] Re: New API: cairo_surface_get_width/height

Robert O'Callahan rocallahan at novell.com
Sun Jun 11 23:06:02 PDT 2006


On Fri, 2006-06-09 at 08:41 -0700, Carl Worth wrote:
> On Fri, 09 Jun 2006 08:07:07 -0400, Owen Taylor wrote:
> > It's certainly worth pointing out that in the motivating case here,
> > the information about inherent clipping is available without adding
> > anything to Cairo; given an XID, it's straightforward to say:
> > 
> >  - What's the GdkDrawable for this XID
> >  - Is that a pixmap?
> >  - What's the size of the pixmap?
> > 
> > In fact, since Robert is about to call GDK theme drawing functions,
> > he's already done the first step.
> 
> OK. So maybe Robert is just fine as far as all this goes. Robert?

What if there isn't a GdkDrawable for the XID, e.g. because someone
called push_group? Then fetching the width/height requires X server
roundtripping.

We originally had a very simple double-buffering implementation using
push_group, and had to drop it in favour of creating a GdkPixmap
explicitly, to avoid exactly that problem. We still get hammered when we
want to paint themes inside a push_group, e.g. when 'opacity' is in use.
To fix that we first have to get GDK to export a
gdk_pixmap_foreign_new_with_width_height API (I believe this is in the
works). Then we have to have a way to get the width and height without a
round trip, which brings us back to needing some kind of surface
width/height API in cairo. I'm find with it being cairo_xlib_surface
getters.

Rob



More information about the cairo mailing list