[cairo] Operator optimization based on source or dest opacity

Soeren Sandmann sandmann at daimi.au.dk
Sat Mar 1 11:32:46 PST 2008


Hi Antoine, 

> I can reject any repeat_none/transformed source for this 
> optimization, but we'll be missing out on a LOT of cases where a user 
> specifies a rectangular opaque source image, translates it and paints 
> it over a destination. Actually this is probably the most frequent 
> case affected, so I'll probably run the xSrc/ySrc/width/height 
> specified through the transformation matrix to check that we're still 
> within the source image when verifying for opacity.

For integer translations, cairo already does the translation by itself
before passing the surface to pixman. See
cairo_pattern_acquire_surface_for_surface() in cairo-pattern.c.

Are surfaces with non-integer translations, REPEAT_NONE, a NEAREST
filter, and where cairo passes exactly the right (correctly rounded!)
coordinates, really that common in the real world?

I might believe that 90 degree, nearest-filtered rotations could
happen.

But frankly in both cases, a simpler, and much bigger, speed-up than
the operator replacement would be to just write a couple of fast paths
that would deal with such simple transformations without the matrix
multiplication and the indirect fetch functions.


Soren


More information about the cairo mailing list