[cairo] Why 16bit coordinate space.

Carl Worth cworth at cworth.org
Mon Jun 26 02:34:05 PDT 2006


On Sun, 25 Jun 2006 23:28:03 -0400, "Paul Giblock" wrote:
> I was just wondering: why does Cairo limit it's coordinate space to
> 16bits.. that is +/- 32768 units?  I don't see why 32bit values are
> not used.

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

>           I'm running into problems with my implementation of a
> scroll-list because the scrollable area can be quite large.  I guess I
> will have to come up with a hack to offset everything after a certain
> increment.

You're not the first person to run into this problem.

The 16.16 split in cairo was originally copied from the X Render
extension, (where X has a 16 bit limit on the sizes of of things like
windows anyway).

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 6 more bits be enough for your application?

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.

-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/20060626/2828f976/attachment.pgp


More information about the cairo mailing list