Performance optimizations while drawing.
Saving the drawn image now can be done in a separate thread without an OpenGL context.