Minor optimization of drawing code in OSX