unwrong/Starling-Extension-Graphics — pull request #46 by jarrodmoldrich (2013-05-21 19:59:41+00:00)
Title: Using degenerates to reduce extra vertex buffers cause by moveTo(...)

Problem:

For the project I'm working on I needed to draw dotted lines and to update them every frame. Using moveTo(..) and lineTo(..) in succession would provide the desired look but would slow the game right down. Upon inspection, I realised that moveTo causes the vertex batch to be terminated and a new one created.

Solution:

Created a new function called moveToWithDegenerates(..). It provides alternative functionality that uses zero-sized polygons to translate from point to point in the graphic without having to start a new vertex batch. This provided highly significant speed gains in situations where lines are segmented.