Fixes a bug in TextShape caching.

TextShape.update always invalidated the cache, which has caused the severe performance issue.

FPS increased:

- iPhone 4 iOS 5 Safari: 3 -> 10
- iPhone 5c iOS7 Safari: 11.5 -> 30
- Nexus 4 OS 4.3 Chrome: 17 -> 30

for some app.