[cairo] Re: New API: cairo_surface_get_width/height

Owen Taylor otaylor at redhat.com
Mon Jun 12 04:35:05 PDT 2006


On Mon, 2006-06-12 at 18:06 +1200, Robert O'Callahan wrote:
> 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.

Isn't drawing outside of Cairo to the push_group() surface going to
kill the ability of Cairo to ever be smart about group surface size?

> 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.

One thing to be careful of is that cairo_xlib_surface_get_width/height()
will cause naming conflicts for language bindings if
cairo_surface_get_width/height() are ever added.

						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/20060612/69b989ac/attachment.pgp


More information about the cairo mailing list