@galacean/engine-loader 1.5.3 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +4 -13
- package/dist/main.js.map +1 -1
- package/dist/module.js +4 -13
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
package/dist/main.js
CHANGED
|
@@ -7445,24 +7445,15 @@ KHR_materials_iridescence = __decorate([
|
|
|
7445
7445
|
var EXT_texture_webp = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
7446
7446
|
_inherits(EXT_texture_webp, GLTFExtensionParser);
|
|
7447
7447
|
function EXT_texture_webp() {
|
|
7448
|
-
|
|
7449
|
-
_this = GLTFExtensionParser.call(this) || this, _this._supportWebP = false;
|
|
7450
|
-
// @ts-ignore
|
|
7451
|
-
if (engineCore.SystemInfo._isBrowser) {
|
|
7452
|
-
var testCanvas = document.createElement("canvas");
|
|
7453
|
-
testCanvas.width = testCanvas.height = 1;
|
|
7454
|
-
_this._supportWebP = testCanvas.toDataURL("image/webp").indexOf("data:image/webp") == 0;
|
|
7455
|
-
} else {
|
|
7456
|
-
_this._supportWebP = false;
|
|
7457
|
-
}
|
|
7458
|
-
return _this;
|
|
7448
|
+
return GLTFExtensionParser.apply(this, arguments) || this;
|
|
7459
7449
|
}
|
|
7460
7450
|
var _proto = EXT_texture_webp.prototype;
|
|
7461
7451
|
_proto.createAndParse = function createAndParse(context, schema, textureInfo, textureIndex, isSRGBColorSpace) {
|
|
7462
7452
|
var webPIndex = schema.source;
|
|
7463
7453
|
var sampler = textureInfo.sampler, tmp = textureInfo.source, fallbackIndex = tmp === void 0 ? 0 : tmp, textureName = textureInfo.name;
|
|
7464
|
-
|
|
7465
|
-
|
|
7454
|
+
return engineCore.SystemInfo._checkWebpSupported().then(function(supportWebP) {
|
|
7455
|
+
return exports.GLTFTextureParser._parseTexture(context, supportWebP ? webPIndex : fallbackIndex, textureIndex, sampler, textureName, isSRGBColorSpace);
|
|
7456
|
+
});
|
|
7466
7457
|
};
|
|
7467
7458
|
return EXT_texture_webp;
|
|
7468
7459
|
}(GLTFExtensionParser);
|