improvements to canvas2d