XShmPixmaps for GdkPixmap



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



CONFIDENTIALITY CAUTION 
This e-mail and any attachments may be confidential or legally privileged. If you received this message in error or are not the intended recipient, you should destroy the e-mail message and any attachments or copies, and you are prohibited from retaining, distributing, disclosing or using any information contained herein. Please inform us of the erroneous delivery by return e-mail. Thank you for your cooperation.
DOCUMENT CONFIDENTIEL 
Le présent courriel et tout fichier joint à celui-ci peuvent contenir des renseignements confidentiels ou privilégiés. Si cet envoi ne s'adresse pas à vous ou si vous l'avez reçu par erreur, vous devez l'effacer. Vous ne pouvez conserver, distribuer, communiquer ou utiliser les renseignements qu'il contient. Nous vous prions de nous signaler l'erreur par courriel. Merci de votre collaboration.



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