[cairo] Why 16bit coordinate space.

Paul Giblock drfaygo at gmail.com
Mon Jun 26 07:08:34 PDT 2006


> Cairo does use 32 bits. It simply uses 16 bits for the pixel location
> and the other 16 bits for sub-pixel positioning.

Ah, I see..  fixed point.

> Now, I don't think that anyone has ever argued that cairo really needs
> as many as 16 bits of sub-pixel positioning, so we could change that
> from 16.16 to something else. Where to put the dividing point? I know
> that fewer than 8 bits of sub-pixel precision would not be
> desirable. Is it enough? Maybe we would want something like 22.10 ?

Would 24.8 bits be good?  I don't need the additional 2 bits over 22,
but I imagine that keeping things on byte boundaries will make things
cleaner. I dunno, I do not really use much subpixel positioning.

>
> Would 6 more bits be enough for your application?
>

22.10 _would_ be enough for my application. 2M is quite an increase
from 32K.  I imagine that someone would still run into this problem
for very large scrollable areas (ie. web pages).  However, this is
where the userlevel hack can be applied by translating the area and
then subtracting from the coordinates being drawn.

> As far as actually implementing this change, I don't think it would be
> all _that_ much work. Some people have even contributed some patches
> in the past that show the initial things that would need to be
> changed, (though I don't think I've yet seen a complete version). But
> you might want to dig those up if you're interested in exploring this
> further.

Great, I'll check out the archives.


More information about the cairo mailing list