[cairo] Fixed point bug

Andrea Canciani ranma42 at gmail.com
Sun Jan 23 09:55:58 PST 2011


2010/12/14 Krzysztof Kosiński <tweenk.pl at gmail.com>:
> W dniu 13 grudnia 2010 20:47 użytkownik M Joonas Pihlaja
> <jpihlaja at cc.helsinki.fi> napisał:
>>
>> Hi Krzysztof,
>>
>> On Sun, 12 Dec 2010, Krzysztof Kosiński wrote:
>>
>>> I recently submitted a bug that, once fixed, would allow Inkscape to
>>> use Cairo for all drawing.

That bug has been fixed and support for gradients in cairo/pixman
should not be much more solid. This and a lot of other improvements
are available in Cairo 1.11.2, which has been released today.
Can you confirm if this is sufficient for Inkscape or file bugs for the other
improvements Inkscape would require?

>>
>> Sorry, I haven't been following your work very closely.  Could you
>> remind me about what exact guarantees you require from cairo/pixman
>> with respect to coordinate ranges and precision and accuracy?
>
> I think this would avoid most problems:
>
> - Gradient coordinates should have at least 24 bits of precision in
> the integral part, or be expressed in a floating point format.

This is already possible with pixman. It's just a matter of using projective
matrices to rescale the whole space. Unfortunately right now it would
provide inferior performance, but it should be possible to improve this.

> - Transformation matrix elements should have 32-bit floating point
> precision on platforms with an FPU.

This would require major changes in pixman and new API.
Moreover AFAICT floating point is frowned upon in the X protocol.
On IRC Soren pointed out that pixman projective transform
allow a bigger range of matrices than what cairo-image is currently
using. This can be achieved by using the projective components to
scale up/down the matrix, effectively trading range size for precision
or vice versa.

> - The test case in the bug should work at least up to 1000000, and
> preferably up to INT_MAX.

Too easy, I already fixed that bug, so you can use values which are
even bigger than that ;)

Andrea


More information about the cairo mailing list