mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
[v3.8.5] Fix that bytedance platform adapter code hacked cc.ImageAsset.data. (#17825)
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
|
||||
// @ts-check
|
||||
import { ccclass, override } from 'cc.decorator';
|
||||
import { EDITOR, ALIPAY, XIAOMI, JSB, TEST, BAIDU, TAOBAO, TAOBAO_MINIGAME, WECHAT_MINI_PROGRAM } from 'internal:constants';
|
||||
import { EDITOR, ALIPAY, XIAOMI, JSB, TEST, BAIDU, TAOBAO, TAOBAO_MINIGAME, WECHAT_MINI_PROGRAM, BYTEDANCE } from 'internal:constants';
|
||||
import { Device, Format, FormatFeatureBit, deviceManager } from '../../gfx';
|
||||
import { Asset } from './asset';
|
||||
import { PixelFormat } from './asset-enum';
|
||||
@@ -163,7 +163,7 @@ function fetchImageSource (imageSource: ImageSource): HTMLCanvasElement | HTMLIm
|
||||
|
||||
// 返回该图像源是否是平台提供的图像对象。
|
||||
function isNativeImage (imageSource: ImageSource): imageSource is (HTMLImageElement | HTMLCanvasElement | ImageBitmap) {
|
||||
if (ALIPAY || TAOBAO || TAOBAO_MINIGAME || XIAOMI || BAIDU || WECHAT_MINI_PROGRAM) {
|
||||
if (ALIPAY || TAOBAO || TAOBAO_MINIGAME || XIAOMI || BAIDU || WECHAT_MINI_PROGRAM || BYTEDANCE) {
|
||||
// We're unable to grab the constructors of Alipay native image or canvas object.
|
||||
return !('_data' in imageSource);
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
if (cc.ImageAsset) {
|
||||
Object.defineProperty(cc.ImageAsset.prototype, 'data', {
|
||||
get () {
|
||||
return (this._nativeData && this._nativeData._data) || this._nativeData;
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -2,4 +2,3 @@ require('../fs-utils');
|
||||
require('../../../../common/engine/index');
|
||||
require('./VideoPlayer');
|
||||
require('./Label');
|
||||
require('./ImageAsset');
|
||||
|
||||
Reference in New Issue
Block a user