Re: Can GTK+ make use of XSHM extension from MIT

On Jan 11, 2008 12:03 PM, Bin Chen <binary chen gmail com> wrote:

Thanks for your reply, but I wonder how the Xlib or GDK knows the
image is drawing in a shared memory segment? In detail can you show me
some pseudo code to how to do it?

Well Gdk does know because it created the backing Image, but doesnt
need to because Xlib knows to treat normal images differently than
shared ones when doing XCopyArea (Gdk needs to know that its shared
only so that it can properly clean up its resources when destroying
the GdkImage).

See in the docs[1] you can even verify by explicitly trying to create
a shared memory pixmap, it will fail if it was not possible to create
a shared memory pixmap.

For X, all Windows Pixmaps Images etc are resources and different
casts of the XID (which is just a numeric resource identifier), if the
underlying Image of the GdkImage is shared, the X server will know
because the X server created/returned the resource identifier.



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