mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-06 11:31:59 +08:00
Fix wechat game issues (#2869)
Fix wechat game upload texture with data issue
This commit is contained in:
@@ -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
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user