[cairo] Pixman coordinates

Krzysztof Kosiński tweenk.pl at gmail.com
Sat Jul 3 06:52:13 PDT 2010

W dniu 2 lipca 2010 07:02 użytkownik M Joonas Pihlaja
<jpihlaja at cc.helsinki.fi> napisał:
> I don't see why not.  Use tiles of size 1024 x 1024 or whatever
> suitable size and clip your paths to a bounding box that's slightly
> larger than the tile size so you only ever send paths to cairo which
> are close to your tile.

I'm already doing this and this doesn't fix anything, because sooner
or later the tile will intersect with the over-32767-pixels path and
the rendering will be corrupted for that tile.

If you mean effectively computing an intersection of the path with a
rectangle slightly larger than the bounding box of the tile, then this
sounds simple but in fact it's very complex, because the stroke can
have dashes. I would have to insert some extra segments so that
dividing the length of the removed parts of segments and the inserted
segments by the dash period gives the same remainder. If there is a
simpler way to solve this in Cairo, I would rather work on that.

> Chuck out any paths outside your tile while
> you're at it so cairo doesn't even have to look at them.
> Incidentally, it's best to use tiles which overlap slightly to avoid
> rendering artifacts from the geometry clipping.

I never encountered any artifacts when using non-overlapping tiles.

> I haven't given much thought to gradients at all to be honest.
> Surface patterns with extreme transformation matrices are likely
> troublesome too.
> Joonas

Regards, Krzysztof

More information about the cairo mailing list