[cairo] 64 bit fixed point in Cairo?

Nicholas Allen nick.allen at onlinehome.de
Thu Apr 14 05:25:18 PDT 2011

Thank you for your response. After looking into the Cairo code we were
coming to a similar conclusion to the solution you suggested. We only
have one widget where these huge numbers are needed and we mostly do
simple primitive drawing (lines and rectangles here) so we will try to
do some clipping of the primitives ourselves to areas just outside of
the visible area of the viewport (say 5 pixels either side). Although a
fair bit of work it seems much less than changing cairo or switching to
another graphics library.

We had a quick look at the anti grain library but it seems that this
also uses 24.8 fixed point code so would not help us anyway.

Thanks again for you answer,


M Joonas Pihlaja wrote:
> On Thu, 14 Apr 2011, Nicholas Allen wrote:
>> The only solution for us that I can see is if cairo could use 64 bit
>> fixed point instead of 32 bit. I'm going to take a look at hacking this
>> in cairo and seeing how far I get. I take it no one else has yet
>> attempted this? If this turns out to be a lot of work we will have to
>> consider using another graphics library.
> Cairo's 32 bit limitation is baked in at several levels and extends to
> pixman as well.  Many people have been concerned about it, but nobody
> has provided a working solution that extends it, yet.  All help in
> this direction is definitely welcome, but you should be aware that
> it's not a trivial change that can be done in a week or two.
> In my experience it's easiest to treat cairo (and any other vector
> graphics library) as a limited precision device and do most user ->
> device transformations and partial clipping (say clip your paths to
> some smallish rectangular area surrounding the view port) on the
> client side, to let cairo only deal with coordinates in a sane range.
> This leaves you in full control of the precision requirements, and
> doesn't require you to go all out with full geometric clipping; that
> way lies a lot of frustrating work.
> If you do end up going with another graphics library, please let us
> know which one worked for you.
> Cheers,
> Joonas

More information about the cairo mailing list