[cairo] Optimizing operators for opaque patterns

Antoine Azar cairo at antoineazar.com
Thu Jan 31 17:24:06 PST 2008


Hey all,

in the case of an opaque source, I've optimized cairo to use a SOURCE 
operator instead of OVER. Mathematically this is exactly equivalent. 
This for example accelerates enormously paint operations in Pixman. A 
quick test showed a 3x boost in speed.

I'm currently doing the check for an opaque source pattern in the 
gstate functions, as this is the first place at which we propagate 
the desired operator to the rest of Cairo. The gstate's operator of 
course stays unchanged, we're just sending SOURCE instead of OVER. 
Let me know if there's a better place for that optimization.

Also, I'm optimizing other composition operators inside Pixman. Each 
operator's composition function can be accelerated if SRC_A and/or 
DST_A is opaque. Other backends should do this if it's not already done.

Best,
Antoine



More information about the cairo mailing list