Implement gfxdraw, with a few new functions.