As you would already know, Quixie is using Cairo for rendering vector graphics. Flash is using Quadratic Bezier curves while Cairo uses Cubic Bezier curve.
After implementing Quadratic Bezier curve, I tried creating a heart and a circle for a simple Valentine’s Day demo, until I noticed something. The image below displays the progress made to Quixie to draw a vector curve that is similar to how Flash renders a curve.

Go and click the image to view larger.
Not sure if it’s just me but it’s only know that I realize that using cubic over quadratic seem to produce better shapes. Don’t know about you guys, but I think the previous implementation of curve-rendering draws the heart and the circle much better.
As expected, looks like Quixie will have to employ both Quadtratic and Cubic Bezier curves, using CurveTo
and a new Draw function CubicCurveTo
.
Also, Cairo doesn’t seem to negate (can’t pick out the right word here) to overlapping shapes. Notice the hole where the heart and circle collided on Flash’s implementation?
You might be wondering why is it so important that Quixie will render vectors the way Flash do. The simple answer is, “easy adaptation” — the same reason DOC, XLS and PPT files can be opened with OpenOffice. Still, Quixie is not being developed to be an open source alternative to the Flash Player — Gnash development team has already been working on it.
By the way, the quadratic beziers are converted into Cairo’s cubic bezier by an algorithm from Mono project — the Moonlight’s moon_curve_to
function.
~creek23
Leave a Reply to svenfx Cancel reply