cocos2d/cocos2d-html5 — pull request #1339 by csaftoiu (2013-12-20 19:34:25+00:00)
Title: always go through glBindTexture2D to ensure consistent cache

I had a rare bug in my program where a texture wasn't generated, with the error "texImage2d: no texture". I disabled the state cache and the bug disappeared. I re-enabled it and tracked it down - the modifications in CCTexture2D.js fixed the bug. I also changed CCLabelTTF.js for consistency. Unfortunately I don't have a [SSCCE](http://sscce.org/) showing the bug but hopefully the logic of it makes enough sense on its own.