17 lines
2.2 KiB
JavaScript
17 lines
2.2 KiB
JavaScript
shadow$provide.module$node_modules$pixi_DOT_js$lib$rendering$renderers$gl$texture$uploaders$glUploadImageResource = function(global, require, module, exports) {
|
|
function uploadImageWebGL2(gl, target, glTexture, textureWidth, textureHeight, resourceWidth, resourceHeight, resource, needsAllocation, resourceFitsTexture) {
|
|
resourceFitsTexture ? needsAllocation ? gl.texImage2D(target, 0, glTexture.internalFormat, textureWidth, textureHeight, 0, glTexture.format, glTexture.type, resource) : gl.texSubImage2D(target, 0, 0, 0, glTexture.format, glTexture.type, resource) : (needsAllocation && gl.texImage2D(target, 0, glTexture.internalFormat, textureWidth, textureHeight, 0, glTexture.format, glTexture.type, null), gl.texSubImage2D(target, 0, 0, 0, resourceWidth, resourceHeight, glTexture.format, glTexture.type, resource));
|
|
}
|
|
function uploadImageWebGL1(gl, target, glTexture, textureWidth, textureHeight, _resourceWidth, _resourceHeight, resource, needsAllocation, resourceFitsTexture) {
|
|
resourceFitsTexture ? needsAllocation ? gl.texImage2D(target, 0, glTexture.internalFormat, glTexture.format, glTexture.type, resource) : gl.texSubImage2D(target, 0, 0, 0, glTexture.format, glTexture.type, resource) : (needsAllocation && gl.texImage2D(target, 0, glTexture.internalFormat, textureWidth, textureHeight, 0, glTexture.format, glTexture.type, null), gl.texSubImage2D(target, 0, 0, 0, glTexture.format, glTexture.type, resource));
|
|
}
|
|
exports.glUploadImageResource = {id:"image", upload(source, glTexture, gl, webGLVersion, targetOverride, forceAllocation = !1) {
|
|
const textureWidth = source.pixelWidth, textureHeight = source.pixelHeight, resourceWidth = source.resourceWidth, resourceHeight = source.resourceHeight;
|
|
(2 === webGLVersion ? uploadImageWebGL2 : uploadImageWebGL1)(gl, targetOverride || glTexture.target, glTexture, textureWidth, textureHeight, resourceWidth, resourceHeight, source.resource, forceAllocation || glTexture.width !== textureWidth || glTexture.height !== textureHeight, resourceWidth >= textureWidth && resourceHeight >= textureHeight);
|
|
glTexture.width = textureWidth;
|
|
glTexture.height = textureHeight;
|
|
}};
|
|
};
|
|
|
|
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$rendering$renderers$gl$texture$uploaders$glUploadImageResource.js.map
|