[cairo] rewriting libpixman

Jeff Muizelaar jeff at infidigm.net
Thu Mar 29 10:33:42 PDT 2007


On Thu, Mar 29, 2007 at 10:17:03AM -0700, MenTaLguY wrote:
> On Thu, 29 Mar 2007 13:02:05 -0400, Jeff Muizelaar <jeff at infidigm.net> wrote:
> > Yeah, the precision conversion code was pretty broken. I haven't
> > actually done any 565 testing yet, so I didn't need it to actually work.
> > Anyways, I've fixed it to do the proper multiply by 255 and divide by 31
> > or 63, but I plan to add support for the bit copying approximation as
> > well.
> 
> The bit-copying "approximation" is exactly equivalent to multiplying by 255 and dividing by 31.  There's no point in implementing both -- stick with the bit copy, since it's more efficient.

(x << 3) | (x >> 2) is not equivalent to (255*x + 15)/31 for x = {3, 7, 24, 28}

-Jeff


More information about the cairo mailing list