
"Maybe I'm just naive, but designing a graphics API such that all image data had to be sent over a socket to another process every time the image needed to be drawn seems like complete idiocy. Unfortunately, that is precisely what the X Window System forces a program to do, and exactly what Cairo does when drawing images in Linux - a full copy of the image data, send to another process, no less, every time it is drawn. One would think there would be some room for improvement. Unsurprisingly, others felt the same way about X, and decided to write
an extension, Xlib Shm or XShm for short, that allows images to placed in a shared memory segment from which the X server reads which allows the program to avoid the memory copy. GTK already makes use of the XShm extension, and it seems like a good idea to see
if Gecko couldn't do the same."
Member since:
2005-07-06
Note that sharing the image between the client and the server is not always the right thing to do as setting up shared memory is costly.
So the wise thing to do is to copy small images and use shared memory only for big one.
As for you're rant against X, I'd say that 'standard X' is network transparent, but when you want to use local optimisations, then it isn't network transparent anymore, which makes sense.
That's why we have toolkits which hide this.