[cairo] Mozilla on Cairo

Robert O'Callahan rocallahan at novell.com
Thu Jun 9 20:07:59 PDT 2005

On Thu, 2005-06-09 at 23:49 +0200, Leon Woestenberg wrote:
> You bias towards FSAA because of a "seam" problem - could you please 
> describe this phenomenon? I do remember an earlier
> thread on the list - but I cannot find it.

Imagine you have a white background and you draw two separate opaque
black rectangles: (0,0)-(5.5,10) and (5.5,0)-(10,10) in mode OVER. With
naive coverage-based antialiasing of the edge at y=5.5, the pixels along
the edge (e.g. the pixel at (5,5)-(6,6)) will end up only 75% black.
Visually, you see a "seam" where two shapes share a common edge that
does not coincide with the edges of pixels. The seam is most troublesome
when the objects are opaque and the same color, but inaccurate rendering
is still happening in other cases.

So far the suggestions have been:
1) force all edges to coincide with pixel edges at layout time
2) draw without coverage-based antialiasing and apply FSAA if resources
3) perform some sort of full-scene analysis (either in the app or in
cairo) to identify shared edges and deal with them

All these solutions have drawbacks. Personally I feel 3) would be slow
and not amenable to hardware acceleration and 1) is undesirable for our
app and sometimes not even possible, so I lean towards 2).

Currently my Mozilla/cairo code pixel-aligns rectilinear rectangles at
draw time and allows seams to show in non-rectilinear cases. This will
be good enough in the short term.


More information about the cairo mailing list