[Xcb] XCBImage

Vincent Torri Vincent.Torri at iecn.u-nancy.fr
Mon Feb 28 11:01:06 PST 2005



On Mon, 28 Feb 2005, Jamey Sharp wrote:

> On Fri, Feb 25, 2005 at 11:38:41PM +0100, Vincent Torri wrote:
> > Hello,
>
> Hi Vincent!
>
> > i've added some stuff about shared memory:
> >
> > xcb_shm_image_create
> > xcb_shm_image_destroy
> > xcb_shm_image_put
> > xcb_shm_image_get
>
> Cool.
>
> > but i miss the offset that i have to pass to XCBShmPutImage and
> > XCBShmGetImage. In the Xlib stuff, it's computed thanks to the
> > address in client (shmaddr member of a XShmSegmentInfo). I've not found
> > it. Does someone has an idea about how to get this address ?
>
> As far as I can tell, under Xlib the application was expected to
> allocate a sufficiently large shared memory segment with shmget(2), and
> store the returned shmid in the XShmSegmentInfo. Then it could ask the
> server to shmat(2) using XShmAttach, and finally XShmPutImage. The
> reason for the offset, if I'm not mistaken, is that multiple images
> could be stored in the same segment. If you know the base address of the
> segment, you can compute the offset the way Xlib does.
>
> I could have sworn Xlib would automatically do this for XPutImage calls
> if SHM was supported, but I can't find any evidence of that now. Looks
> like I was thinking of Xlib's Font.c, which can sometimes use shared
> memory for querying fonts.
>
> You did find Xext/XShm.c and XExtensions/XShm.h in fd.o CVS, right? I
> assume that's what you based your implementation on...

yep, of course :)

in fact, i was not aware that shmat was not a Xlib function
so that i could only ask for the returned value of shmat, i think. And
then, it's easy to implement :) Am i wrong ?

Of course, the design could be re-written. It's a first attemps. But if it
works, it would be great.

Ho, and maybe I forget : anyone, HEEEEEEEEEEEEEEEEEEEEELP me for XYPixmap
format :) thanks :)

Vicent Torri


More information about the xcb mailing list