[cairo] Re: Testing for opaque patterns

David Reveman davidr at novell.com
Sun Mar 6 11:26:54 PST 2005


On Fri, 2005-03-04 at 12:40 -0500, Owen Taylor wrote:
> Here's a patch I'm about to apply that adds _cairo_pattern_is_opaque()
> 
> I noticed that in various places we were checking 
> pattern->alpha != 1.0, which isn't going to handle alphas of 0.9999
> or whatever. 
> 
> The exact method to check for opaque is debatable. I took the 
> generous approach of saying that an alpha value is opaque if 
> alpha * 0xffff >> 8 >= 0xff .. which is what all the current backends
> end up using.
> 
> Regards,
> 						Owen

That's a nice improvement. Thanks!

I committed some additional fixes to the gradient stuff in the glitz
backend, it should be ok now.

-David




More information about the cairo mailing list