[cairo] OVER / SOURCE optimization for cairo_paint

Antoine Azar cairo at antoineazar.com
Tue Feb 19 12:11:12 PST 2008

>I was hoping someone else would pick up this topic, but since nobody
>else has: is this really a legitimate optimization when the
>source is scaled or transformed?
>  - It will produce clearly incorrect results unless you replace
>    EXTEND_NONE with the (not yet implemented?) EXTEND_PAD, since
>    SOURCE for EXTEND_NONE is going to give 0,0,0,0 pixels outside
>    the edge.

Hi Owen,
You're right about this, and I already fixed this in the latest patch 
I sent to the list. I'd really appreciate it if you had a look at it 
and gave me some feedback.

>In my opinion, optimizations should not change appearance in such a 
>way ... even if the appearance is better .... because it means
>that you get discontinuities between the optimized path and when you 
>can't optimize for one reason or the other.

Agreed. My latest patch shouldn't show any differences, as far as I 
was able to test it.

>The other thing I wonder about the patch in general: what's it going 
>to do for a backend where OVER is normal and SOURCE abnormal? Does the
>backend have to reverse the optimization? (In other words, the 
>question is: should this optimization be in the image backend at a 
>low level or even inside libpixman, rather than in cairo-gstate.c?)

That's an interesting question, I actually didn't think any backend 
could perform faster while doing compositing rather than just 
overwriting the dest with the source pixels. Is it really the case?


More information about the cairo mailing list