[cairo] [Patch] make _color_to_short() use _cairo_fixed_from_double()

Behdad Esfahbod behdad at behdad.org
Wed Jan 24 08:18:31 PST 2007


On Wed, 2007-01-24 at 09:37 -0500, Jorn Baayen wrote:
> Hi,
> 
> I attach a patch to make _color_to_short() in cairo-color.c use
> _cairo_fixed_from_double(). This does not produce any measurable
> speedup, but I'd say it's good for consistency.

cairo_fixed_from_double() rounds, but we want to floor in this case.
At the end it doesn't really matter as we are talking 16bits of color
per channel, but also there's no need to regress.

behdad

> Regards,
> 
> Jorn
> 
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo
-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759





More information about the cairo mailing list