add some 2d drawing optimazation