[cairo] 16-bit precision issues in cairo

Owen Taylor otaylor at redhat.com
Fri Aug 12 08:44:24 PDT 2005

On Sat, 2005-08-13 at 00:11 +1000, Russell Shaw wrote:
> Owen Taylor wrote:
> > On Thu, 2005-08-11 at 21:32 -0700, Carl Worth wrote:
> ...
> > Generally, *rendering* to areas outside the 16-bit coordinate space is
> > is uninteresting. But rendering *primitives* larger than 16-bits
> > is quite natural and normal.
> > 
> > We've seen quite a few reports of problems with GTK+ which has the
> > limitations of X for rendering primitives larger than 16-bits. 
> > People create gigantic windows for scrolling, then try to draw
> > lines or rectangles across the entire window.
> > 
> > This doesn't seem that easy to fix in Cairo - by the time we get to a
> > point where it is easy to clamp, we are already in 16.16 coordinates. 
> > But it's something worth keeping in mind. If we were willing to waste
> > code space, we could imagine having a separate 48.16 path 
> > implementation and rasterizer that we fell back to when we encountered
> > out-of-bounds points.
> > 
> > (16.16 is really somewhat of a questionable split - do you really need
> > 1/65536'th of a device unit? Pango uses 20.12, Windows, 24.8. 
> > Not that I'm suggesting changing cairo at this point.)
> In making a few cad programs, i've found the best way that minimizes memory
> and maximizes drawing speed is had by not drawing everything in the whole
> document when the portal (viewable area) is a zoomed in tiny portion of the
> document. The users program or graphic library should be smart enough to
> omit drawing primitives outside the viewable area before xlib even gets to
> see anything. If users render things exceeding 16 bits, it's their own fault.

Very simple programs dealing with large scrolling areas can encounter
this problem; asking them to clip themselves is something I'd prefer
not to have to do.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050812/a4c82629/attachment.pgp

More information about the cairo mailing list