[Xcb] libXrender port to XCB

Jamey Sharp jamey at minilop.net
Mon Jun 12 13:21:44 PDT 2006


On Mon, Jun 12, 2006 at 01:51:38PM +0200, Vincent Torri wrote:
> hey, Jamey

Hi Vincent!

For those not watching the commit list, I've added a "renderutil"
library to xcb-util containing a port of libXrender to XCB. I omitted
all the functions that directly correspond to the protocol, of course,
and also XRenderParseColor and XRenderCompositeDoublePoly. I'm not sure
if ParseColor is useful, and it calls down to XParseColor which uses
both Xcms and Xlib's i18n code, so the full behavior is non-trivial to
port.

Beware: the code I committed is entirely untested (though I made sure it
compiles) and the cache functions (XCBRenderUtilQueryVersion and
XCBRenderUtilQueryFormats) won't work until Plan 7 is implemented.

On the other hand, that means we now have an example of code that can
make good use of Plan 7:
	http://gitweb.freedesktop.org/?p=xcb;a=blob;hb=HEAD;f=xcb-util/renderutil/cache.c
The equivalent code in libXrender has a comment that says, "I suspect
this is not really thread safe, but Xlib doesn't provide a lot of
options here":
	http://cvsweb.freedesktop.org/xorg/lib/Xrender/src/Xrender.c?rev=HEAD&view=markup
... Yay us. :-)

> thank you for these utility functions. I'll use them in the xrender xcb
> engine of evas. It will remove some code, as i've coded them for the
> engine :-)

Yeah, I wanted to kill the similar code I put into Cairo. Someone added
a comment there:

/* XXX: Why is this ridiculously complex compared to the equivalent
 * function in cairo-xlib-surface.c */

:-)

> May I ask you to look at the xrender functions that draw a polygon too ?
> :-D The engine needs them too, and i've not written them :-D

You may ask, but following Keith's advice I intentionally left
XRenderCompositeDoublePoly out of my port:
	http://lists.freedesktop.org/archives/xcb/2006-February/001318.html

I don't know what to suggest for you though. Probably you should get
raster to read whatever papers Carl and Keith have been reading about
tesselating polygons, and convince him to replace the call to
XRenderCompositeDoublePoly with something more appropriate. You can
point out the memory allocation, sorting, and computation overhead of
the current code if it helps any. :-)

--Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20060612/62d71b09/attachment.pgp


More information about the Xcb mailing list