// 环境
浏览器; chrome
自动使用的WebGL模式,
执行测试用例:TextureCacheTest.js
Uncaught SecurityError: Failed to execute ‘texImage2D’ on ‘WebGLRenderingContext’: The cross-origin image at http://www.cocos2d-x.org/attachments/download/1508 may not be loaded.
TexturesWebGL.js:467
强制使用canvas renderer显示正常,不过在console中会报跨域的警告
Image from origin ‘http://www.cocos2d-x.org’ has been blocked from loading by Cross-Origin Resource Sharing policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://127.0.0.1:8081’ is therefore not allowed access.
在本地环境中搭建http服务器,写了个测试文件,不会报跨域警告,代码如下