[cairo] Seams with the image backend
M Joonas Pihlaja
jpihlaja at cc.helsinki.fi
Sat May 2 04:14:06 PDT 2009
Hi,
On Sat, 2 May 2009, Soeren Sandmann wrote:
> The root of the problem is likely that the new polygon rasterizer is
> rounding input coordinates to closest subpixel sample position before
> DDA'ing, whereas the trapezoid rasterizer in pixman is DDA'ing in the
> full 16.16 coordinate space and only rounds when actually sampling.
Yes, this seems to be the root cause of the artifacts.
> Should/does cairo provide any guarantees in this area? Possibilities
> include:
>
> (a) No guarantees.
>
> (b) No seams between polygons that share an edge that is specified
> with the same coordinates in the two polygons.
>
> (c) No seams between polygons with edges that coincide.
>
> At the moment the image backend provides (b). I believe the pixman
> trap rasterizer provides (c), with the caveat that the edges must
> coincide given the precision of the 16.16 arithmetic.
Pixman may give c), but the way cairo drives it erodes that guarantee
because cairo internal coordinates are 24.8. It's not hard to create
examples where there's a slight seam between what should be collinear
edges using pixman rasterisation also, again due to the finite
precision of path coordinates. The finite precision issue is always
going to be there, so unless we start doing something drastic, c)
isn't really a guarantee we can provide I think. At best we can and
probably should be giving b). Of course, the closer we get to
seamless operation the better.
Cheers,
Joonas
More information about the cairo
mailing list