Improved the performance on how shapes are drawn.