Re: XShmPixmap for GdkPixmap



On Wed, 2007-05-23 at 15:36 -0400, Owen Taylor wrote:
> On Wed, 2007-05-23 at 15:12 -0400, Tristan Van Berkom wrote:
> 
> > Something like this ?
> > 
> > GdkPixmap *
> > gdk_pixmap_new_shared (GdkDrawable *drawable,
> > 			gint         width,
> > 			gint         height,
> > 			gint         depth,
> > 			GdkImage   **image_ret)
> > 
> > This way one could be specific about when using an XShmPixmap
> > suits thier need, which is good enough for me.
> 
> Multiple returns, ugh :-)
> 
> Maybe just:
> 
>  GdkPixmap *
>  gdk_image_get_shared_pixmap(GdkImage *image);
> 
> Documenting that the depth and screen of the returned image
> are determined by the GdkVisual.

Ah yes much nicer - as I was lost in gdkimage-x11.c (and
_gdk_image_new_for_depth) I missed that one could explicitly 
create a shared image.

Another point worth documenting is that a shared GdkPixmap
is garbage if you destroy the underlying GdkImage (being
a foreign resource the way I see it... I wonder how that
would translate on win32)

> Plus a gdk_display_supports_shared_pixmaps() or similar.
> Note that gdk_image_new(.., GDK_IMAGE_SHARED) might still fail
> if the display supports shared pixmaps, but once the image
> is created, we can guarantee that gdk_image_get_shared_pixmap() 
> will work.

Mhm, need to check if the extention is there and if the display
is local.

Cheers,
                  -Tristan





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