Shapes and Drawing

Beside fonts and texts, the most problematic field was the drawing and positioning of shapes.

During the 10+ years of its development, Flash Player has been patched up with a number of functions that serve to repair the errors of .swf generating softwares. These patches were missing from Shumway due to the closed nature of Flash Player. One of these errors was the fill of shapes. Here is an example:


The goal is to fill the area between Circle A and B. For this task, we use a vector graphics algorithm:


The clockwise-wound shapes are filled with the given colour, while the counterclockwise -wound shapes are filled with the background colour. The situation, however, was somewhat more complex, as the generated .swf files typically render shapes broken down into smaller shapes. Hence, first the real shapes had to be re-assembled, path directions examined and in cases inverted.

Not only the drawing, but also the positioning differed from that of Flash Player. One of the curious heuristics missing from the positioner was causing a single shape - even a complex sprite - on the flash stage (exactly the size of the stage) to be centered by the Flash Player.

To sum up, the functions to which Adobe provides open access are emulated well by Shumway, but there is still much to be done in the field of implementing the heuristics of the closed Flash Player system.