[Xcb] XPutImage and context switches / roundtrips?

Clemens Eisserer linuxhippy at gmail.com
Wed Sep 10 15:03:04 PDT 2008


Thanks a lot to all the suggestions and ideas howto improve the
current situation.

Some explanation to my use-case:
Java does antialiasing by generating alpha-tiles in software,
uploading it to a pixmap and uses that mask with a source.
So what I do is uploading the alpha-data using XPutImage and later use
the pixmap in a composite operation.
I can't simply change the way Java does antialiasing because I am just
writing another backend based on XRender (X11, D3D, OGL and GDI exist
for now), however this is for my case an important optimization.

SHM is no real option for me, because after every 32x32 tile the
higher-level framework expects the rendering to be done.
This would mean for every 32x32 tile (or even smaller) I would have to
force a sync.
I can try to change the higher-level code but this does not "belong"
to my work and in general I doubt I can get any changes in that code
Of course its a long-term goal, but fixing it on the non-shm case
would be great too, of course.

> I'm not so up for having some run-time
> mechanism to be able to configure the buffer size, because
> it introduces some complications and is almost never needed,
> but there probably should be a config option to change it
Well, compile-time would mean all applications would have to use the
fixed-size buffer, regardless wether they need it or not.
With an API (or a non-api based hack) it would be possible for apps to
specify their preferred buffer size, which still could be limited by a
compile-time constant.

> Depending on how often your small images change, you might be able to register them as background images with a GC once and draw them
> repeatedly that way.
Unfourunatly the image changes for every operation, so this
optimization does not apply here.

Thanks again, Clemens

More information about the Xcb mailing list