Fix wechat game issues (#2869)

Fix wechat game upload texture with data issue
This commit is contained in:
kenshin
2018-06-20 15:53:21 +08:00
committed by pandamicro
parent 832c3f93ce
commit 6c3f32669d
+3 -4
View File
@@ -803,10 +803,9 @@ game.once(game.EVENT_RENDERER_INITED, function () {
_p._setImage = function (img, width, height, glFmt, premultiplyAlpha) {
var gl = this._gl;
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, premultiplyAlpha);
if (
(sys.platform === sys.WECHAT_GAME && !(img instanceof Uint8Array)) ||
sys.platform === sys.QQ_PLAY ||
img instanceof HTMLCanvasElement ||
if (
sys.platform === sys.QQ_PLAY ||
(img instanceof HTMLCanvasElement && !(img instanceof Uint8Array)) ||
img instanceof HTMLImageElement ||
img instanceof HTMLVideoElement
) {