[Xcb] To do

Jamey Sharp jamey at minilop.net
Sun Feb 6 14:38:19 PST 2005


On Sat, Feb 05, 2005 at 06:29:37PM +0100, Vincent Torri wrote:
> > Ooh, that's cool. If you've implemented everything that XImage supports,
> > then you've figured out possibly the most confusing part of the core X
> > protocol. Congratulations! You'll have to explain it to me sometime. :-)
> 
> I've not implemented all the functions. I've only create a similar
> structure, and implemented:
> 
> xcb_image_create
> xcb_image_init
> xcb_image_destroy
> xcb_image_get
> xcb_image_put
> xcb_image_put_pixel
> xcb_image_get_pixel
> 
> for now, only xcb_image_put does not work (from one test). I don't
> understand why. Is there a known reason why XCBPutImage would do nothing ?

Are you checking for X errors in response to your PutImage? It's hard,
in my opinion, to get the parameters right, and the X server will at
least tell you if you get them wrong.

The only time I've successfully coded a call to XCBPutImage was when I
carefully copied code from XImage and then Keith Packard fixed my bugs.
(So I guess you could say I've never successfully used PutImage.) That
code is in
	http://cvs.cairographics.org/cairo/src/cairo_xcb_surface.c?rev=HEAD&view=auto
in the _cairo_xcb_surface_set_image function.

The only other correct use of XCBPutImage that I'm aware of is in David
Reveman's rendertest program, in
	http://cvs.cairographics.org/rendertest/src/xcb.c?rev=HEAD&view=auto
in the _xcb_render_set_pixels function. (That program turned out to be
the first test case for XCB's support for the BIG-REQUESTS extension,
for whatever that's worth.)

> What should i use for the graphic context to pass to it ?

You could create a new GC and use it once for your PutImage request,
like David's code does. There are some GC parameters that I imagine do
interesting things to PutImage requests, but that interaction is poorly
documented, as far as I can tell.

> > Unfortunately, if your code does everything XImage does, that means that
> > it's more complicated than the piece I want to put in XCB, which I think
> > shouldn't do any format conversion -- just image splitting for core X,
> > and SHM where possible. Fortunately, I think that's probably easy
> > functionality to separate, so we can put the little stuff in libXCB and
> > make the rest available as a separate library or something.
> >
> > I look forward to seeing your code, anyway.
> 
> Well, it's almost all the code from Xorg (all the difficult part). I don't
> think it's very interesting. And even if i understand lots of the code,
> some parts are mysterious for me :)

One of the high-priority tasks on the XCB to-do list for a long time has
been to "Understand and document X image formats, as per GetImage and
PutImage..." That's because when I was trying to write the original XCL,
I discovered that both the code and the documentation are mostly
incomprehensible in this area.

I've just Googled for image format documentation again, but still can't
find anything very useful.

--Jamey


More information about the xcb mailing list