[cairo] Pixman coordinates

M Joonas Pihlaja jpihlaja at cc.helsinki.fi
Sat Jul 3 11:06:31 PDT 2010


On Sat, 3 Jul 2010, [UTF-8] Krzysztof Kosi?ski wrote:

> 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.

Normally it's over-8M pixel paths, but otherwise spot on.

> If you mean effectively computing an intersection of the path with a
> rectangle slightly larger than the bounding box of the tile, then this

Yes, this is actually what I meant.

> sounds simple but in fact it's very complex, because the stroke can
> have dashes.

You can split a single stroke operation into multiple stroke 
operations at stroke entry/exit points of the clip box and set the 
dash offset at each entry point.

This all is simple at the application level as then then app takes 
responsibility of any precision problems arising from clipping.

> If there is a simpler way to solve this in Cairo, I would rather 
> work on that.

A good start would be to rearchitect cairo to 1) not use a fixed point 
internal representation of paths, and 2) defer mapping from user to 
device space, preferably leaving both decisions to each individual 
backend.  Not that I think this is actually a *simpler* way to solve 
it. :)

Cheers,

Joonas


More information about the cairo mailing list