Pushing image transport logic down the stack

Olivier Galibert galibert at pobox.com
Tue Sep 5 10:10:09 PDT 2006


On Sun, Sep 03, 2006 at 05:16:39PM -0400, Owen Taylor wrote:
> The simplest way to handle it is that you create a temporary image in
> memory, you convert into that image, then you call XPutImage().

I've always considered the way XImages are handled to be broken by
design for exactly this kind of reasons.

What about a XImage variant, let's call it XFastImage, where
XCreateFastImage does _not_ have the data, bitmap_pad and
bytes_per_line parameters.  The library will be responsible for
allocating the buffer and setting the paddings, the application will
not be allowed to change the pointer.  Add to that that XPutFastImage
destroys the XFastImage and you get the lifetime and reuse of the
buffer completely under control of the library/DRI/whatever.

You can use network sockets, shared memory, agp-adressible pages,
whatever, the application won't have to care, and if you avoid macro
accessors won't even need a recompile.

  OG.




More information about the xorg mailing list