[cairo] CAIRO_BO_GUARD_BITS and coordinate space?

Carl Worth cworth at cworth.org
Mon Dec 4 08:48:06 PST 2006


On Mon, 04 Dec 2006 00:22:23 -0800, Vladimir Vukicevic wrote:
> What's going on here?  We were able to use coordinates up to 32766
> before the new tessellator, now we're down to 8192?

Sorry about that.

The BO_GUARD_BITS thing I did was meant as a quick hack to make a
robustness issue "just go away". I had meant to clean this up before
ever landing it, (but then Joonas went and built so much good stuff on
top and showed it performing so well that I just went and merged it
anyway).

So, a long-term approach would be to more carefully analyze what
problem I was solving with BO_GUARD_BITS and take care of it more
carefully, (for example, I think I only needed one more bit, but I
stole two---and even better we might not need any guard bits here if
we just take care to ensure we leave enough bits in the intermediate
intersection results to get the correct comparisons we need).

Meanwhile, though, there's a short-term fix that should be much
easier. The point of BO_GUARD_BITS is to get a couple of 0s into the
least significant bits. The implementation is doing this with shifting
right now, (causing the bug you reported), but could do it with
masking to steal the bits from the other end, (and we won't even miss
them there---it will just mean 14 instead of 16 bits of sub-pixel
precision).

Joonas even noticed this problem and recommended the masking already,
so I wouldn't be surprised if he had code for this soon, (if not in
hand already).

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20061204/ccddfda2/attachment.pgp


More information about the cairo mailing list