[cairo] Avoiding seams (again)
otaylor at redhat.com
Thu Mar 23 15:33:12 PST 2006
On Wed, 2006-03-22 at 22:18 -0800, Vladimir Vukicevic wrote:
> On 3/22/06, Timothée Lecomte <timothee.lecomte at ens.fr> wrote:
> > Hi !
> > Do you remember the thread about avoiding seams between paths a months ago ?
> > Well, I am still facing this problem with no ideal solution.
> We're running in to this problem in mozilla-land as well, in
> particular with thick border rendering. Since CSS borders can have
> different colors/patterns/etc. for each side of the border, they tend
> to get drawn as trapezoidal wedges for solid colors. Right now, with
> our cairo builds, we end up with a seam there, as seen in the
> testcases in bug https://bugzilla.mozilla.org/show_bug.cgi?id=328241 .
> We don't really have a good solution yet; I don't think SATURATE is an
> option for us, since we're slow enough as it is (though it might be
> acceptable for certain situations where we know we're going to run
> into this, like thick borders). We've been considering supersampling,
> maybe extending push group/pop group to support supersampling
> internally, but we haven't done any investigation down that path yet
This particular problem (as with many cases where the geometry is known
in advance) should be pretty manageable by just drawing the border
in a separate group with ADD and compositing the result.
You'd probably want to special case the normal all-borders-the-same
case and draw it with 4 rectangles for efficiency.
More information about the cairo