Performance improvement when drawing complex shapes