[cairo] On multiplying alpha

Jeff Muizelaar jeff at infidigm.net
Fri Feb 1 18:38:00 PST 2008

On Fri, Feb 01, 2008 at 09:00:27PM -0500, Behdad Esfahbod wrote:
> On Fri, 2008-02-01 at 20:07 -0500, Jeff Muizelaar wrote:
> Nice trick.  Thanks!
> So, on whole pixels that means:
>   Fb: 2 mul, 15 add/shift/and
> mine: 3 mul, 10 add/shift
>   or: 4 mul,  6 add/shift
> Interesting to see on which hardware which means what.  The best one in
> a particular case also depends on how much packing/unpacking you'd need
> to do too of course.

The numbers you gave for 'mine' and 'or' would probably need at least an
additional 9 or so add/shift/and operations to do the unpacking and
packing, which means that 'Fb' method is nearly always going to be faster.


More information about the cairo mailing list