[cairo] Testing for opaque patterns

Owen Taylor otaylor at redhat.com
Fri Mar 4 09:40:32 PST 2005


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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: opaque.patch
Type: text/x-patch
Size: 7498 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050304/30b5ac4d/opaque.bin


More information about the cairo mailing list