Signature for createTexture changed a while back - http://blog.tojicode.com/2010/07/obsolete-teximage2d-wha.html
Found that FireFox supported this, but Chrome lagged behind, so
I create textures as below. Remove this when all browser are using
the new signature.
try {
/* New API change - https://xeolabs.lighthouseapp.com/projects/50643/tickets/129-fix-for-calling-obsolete-teximage2d
*/
context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, context.RGBA, context.UNSIGNED_BYTE, cfg.image);
} catch (e) {
/* Fall back for old browser
*/
context.texImage2D(context.TEXTURE_2D, 0, cfg.image, cfg.flipY);
}