an open source extensible Flash™ runtime


Here's how Flirt renders the classic Postscript tiger (converted to SWF):

You'll probably notice the bugs first:

Some fills are leaking, some fills are inverted (empty on the inside, jaggy on the out) - This is the biggest headache I've got with Flirt right now. The edges aren't staying in the right left-to-right order, and I can't figure out a good way to make sure they do. The files themselves shouldn't ever give a shape with overlapping edges, but when curves are approximated with a bunch of line segments, things can get a little sloppy.

The whiskers should be outlined - Flirt doesn't yet draw lines with greater than pixel-size width. Pixel-width lines are drawn with Wu-antialiasing—you can see a bunch of pixel gaps in the black outline; that's where Flirt doesn't know to connect two line segments. Thicker lines should be turned into shapes and fed into the shape rasterizer, but I've been putting off doing the math.

Flirt can't figure sub-pixel coverage - You can't see it here, but another rendering bug I haven't thought of a good solution for is shapes bleeding out from underneath other shapes. This is, I understand, a pretty common rendering problem, but I haven't done the research to learn how it's fixed. Yeah, yeah, I know: subsampling. See below.

But if you're generous, you'll note the positives:

Antialiasing - I've never liked subsampling for antialiasing; near-horizontal and near-vertical lines look really bad, and text can be ugly as well. Flirt uses simple geometry to compute coverage values. I know there's probably a fancy, professional term for this, but I'm not in the biz.

Gradients - Sure, it took less than an hour to implement because Flash gradients are really simple, but they do look nice. Could be a lot faster, though.

Here's some more rendering bugs:

All content copyright (C) 2004 Dave Hayden except where noted otherwise.
Macromedia and Flash are registered trademarks of Macromedia, Inc. in the United States and/or other countries.