SVG elliptical-arc path components should use same ellipse-to-Bezier conversion as rounded rectangles




8 years ago
8 years ago


(Reporter: zwol, Unassigned)


Firefox Tracking Flags

(Not tracked)




8 years ago
SVG <rect> elements (and HTML blocks with nonzero border-radius specified in CSS) are drawn with gfxContext::RoundedRectangle, which uses an ellipse-to-Bezier conversion customized for that purpose, with a precalculated magic constant and arithmetic.  SVG <path> elements containing 'a' or 'A' operators, on the other hand, are drawn with a very general ellipse-to-Bezier conversion implemented by nsSVGArcConverter.  Therefore, if you try to match a rounded rectangle with a <path> command, you will not get exactly the same Beziers and therefore not exactly the same antialiasing.  You might want to do this if you were trying to write an SVG reference for an HTML reftest, and rx/ry on <rect> were inadeqate -- see bug 559426 for an example -- so it's an actual problem rather than a theoretical one (as you know, reftests fail if even one pixel is off by even one color step).

It would be nice to make the two match.  There is also need in nsCSSRendering for a somewhat more general elliptical-arc path construction function, so my preferred way to solve this would be to add an elliptical_curve_to() API to cairo; gfx folks therefore cc:ed.
You need to log in before you can comment on or make changes to this bug.