[cairo] [Patch] Some work on cairo-xcb

Uli Schlachter psychon at znc.in
Fri Dec 17 12:02:55 PST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

attached are two patches for cairo's XCB backend. These are the last bugfixes
that I have laying around.

The first one clips unbounded operators to the unbounded extents. This avoids
some rounding issues in the transformation to the Xrender traps from which the X
server then again computes extents. This fixes clip-fill-{eo,nz}-unbounded.
Chris Wilson said he didn't like the memory allocation that is added here, but I
didn't succeed in avoid it (although I haven't searched too hard). Feel free to
tell me how this could be done.

The second commit removes a wrong optimization. Using a clear surface as a
source is optimized into a solid transparent / solid black source. However, for
the solid black source image, the drawing needs to be clipped by the source if
the pattern has a CAIRO_EXTEND_NONE. This causes the clear-source test to fail.

I plan to add the correct part of this optimization to gstate, but this needs
_cairo_pattern_is_solid which is still sitting around in some git branch waiting
to be finished up.

These two patches are also available at:
  git://git.znc.in/psychon/cairo.git for-master


Now for something else:
The cairo-xcb backend currently uses xcb_take_socket and xcb_writev to directly
send data on the X11 connection. This bypasses the auto-generated XCB code and
some of this bypassed code is needed to correctly detect sequence number wraps.
This means that the xcb connection can stall, waiting for a reply from the X
server that was already received.

The best solution here might be to use the auto-generated API from xcb. I
started a git branch for this which is available at:
  git://git.znc.in/psychon/cairo.git xcb_no_take_socket
  http://git.znc.in/?p=psychon/cairo.git;a=shortlog;h=refs/heads/xcb_no_take_socket

The commits are quite ugly right now, but the end result seems to work fine and
have similar performance than the current code. The big upside of this is:
 9 files changed, 121 insertions(+), 1181 deletions(-)

If no one complains about the idea, I'll clean this up and send it for inclusion
when time permits.

Cheers,
Uli

P.S.: Thanks to Andrea Canciani for looking at that code and finding
xcb_send_request()!

- -- 
"Do you know that books smell like nutmeg or some spice from a foreign land?"
                                                  -- Faber in Fahrenheit 451
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBCAAGBQJNC8HtAAoJECLkKOvLj8sGgl4H/j0GVE9zIpQXoNguyo1GkXn2
w8ZchrJiM+FYfZQoEdDoczJpDkGNuucaA91DmFfacep5gv1PP8fUe9bKwLUIdrfK
BQXhkvQQA10w5wFzVb5spaVFatF+s8ZL+4DzlnqjqLbqyngpBUz6NatxI7RJQWKs
qv1HN7nlPeBmv+eWA7mQlHpHxUJDcWqw8qL6ix8ok7FIvSOb94ieagWwF1MqyhWd
xzt3q9VG1ZNuwtFJnEuOPrOlvKR1ONbRZdXb3gOLJukJqqS75Bkq5Wz6SaQeepSD
VTSp2tv+gYfcDx0Meys1FzZBlfZo2pf1UuV3ngQhwRTLQZgwEdxMTGZcnbbiP9s=
=wdko
-----END PGP SIGNATURE-----


More information about the cairo mailing list