[cairo] Image resampling [PATCH 0/6]

Krzysztof Kosiński tweenk.pl at gmail.com
Tue Nov 27 16:51:09 PST 2012


2012/11/27 Bill Spitzak <spitzak at gmail.com>:
> Cairo may want to pre-scale the source surface by an integer factor using a
> box filter so that the sampling filters are not so large. It would then have
> to keep this scaled image around until either the source image is dirtied or
> a transform requiring a different scale is used. I would think this could
> speed up repeated drawing of a much-scaled-down image considerably. It does
> seem to me that such a step should be done by cairo rather than pixman. The
> alternative is for client programs to do this with extra Cairo surfaces for
> the scaled images, but that seems to not be keeping with the easy-to-use api
> intentions of Cairo.

Why not go a little further and implement mipmaps? This would
dramatically speed up the case where an image is repeatedly drawn with
very different transformations, e.g. as is the case when transforming
a bitmap in Inkscape. I guess this would need some support from
Pixman, however.

Regards, Krzysztof


More information about the cairo mailing list