I was able to measure a speedup by caching the fact that the graphics context's transform is identity.
Created attachment 17193 [details] patch
Comment on attachment 17193 [details] patch r=me