cairo surface from GdkPixmap



I'm trying to draw a GdkPixmap to a window with a transformation. I can
do this using:

surface = cairo_xlib_surface_create (gdk_x11_drawable_get_xdisplay (widget->window),
				     gdk_x11_drawable_get_xid (pixmap),
				     gdk_x11_visual_get_xvisual (gdk_drawable_get_visual (widget->window)),
				     width, height);
cairo_set_source_surface (cr, surface, 0, 0);

I see that we have:
void gdk_cairo_set_source_pixbuf (cairo_t      *cr,
				  GdkPixbuf    *pixbuf,
				  double        pixbuf_x,
				  double        pixbuf_y);

But no gdk_cairo_set_source_drawable(). In fact,
_gdk_drawable_ref_cairo_surface() which does exactly what I want is a
private function. What is the reason for this?

I realize that such a surface can only be used with a native Gdk
drawable surface destination, but using such drawables as sources can't
be that uncommon? Don't we want to allow it?

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a scrappy Catholic sorceror from a doomed world. She's a blind goth fairy 
princess living homeless in New York's sewers. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]