XShmPixmap for GdkPixmap
- From: Tristan Van Berkom <tvb gnome org>
- To: gtk-devel-list gnome org
- Subject: XShmPixmap for GdkPixmap
- Date: Wed, 23 May 2007 12:20:12 -0400
Hi,
For a project I'm working on I'm trying to get GdkPixmaps to in fact
be XShmPixmaps when displaying the app on an X server running locally.
This has the advantages of:
- Reduced ipc with the xserver (since the graphics are stored in
a shared memory segment) - thus less task switches at application
startup time.
- Improved memory management: in our experience, we load 20MB to 50MB
of pixmaps for parts of our interface (album cover images on a
jukebox), those images are freed from server memory when exiting
these conditional parts of the interface, but what happens is
that the X server doesnt release these resources to the system
(i.e. those freed resources remain on the X server slab as the
freed memory doesnt always equate to full pages of free memory)...
Using XShmPixmaps would have the advantage of using shared memory
segments which would be immediately returned to the system when
the pixmap is freed.
I'm currently considering a hack where I will simply do:
- load pixbuf
- put the pixbuf in a GdkImage (GdkImage already uses XShmPixmap)
- use gdk_pixmap_foreign_new() on _gdk_x11_image_get_shm_pixmap()
When it struck me, would it not be a good thing if all GdkPixmaps used
XShmPixmap where possible ? (i.e. server extention available && running
locally)
Anyway, I'll probably be working on a GdkPixmap alternative that uses
XShmPixmap where possible and would be happy to contribute this to gtk+,
please let me know if anyone has any thoughts or pointers for me,
has this been discussed before ? are there reasons why GdkPixmap doesnt
already use XShmPixmap ?
Cheers,
-Tristan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]