Files
il/resources/public/js/cljs-runtime/module$node_modules$pixi_DOT_js$lib$rendering$renderers$gl$state$mapWebGLBlendModesToPixi.js
2026-07-01 22:38:29 -06:00

26 lines
1.5 KiB
JavaScript

shadow$provide.module$node_modules$pixi_DOT_js$lib$rendering$renderers$gl$state$mapWebGLBlendModesToPixi = function(global, require, module, exports) {
var adapter = require("module$node_modules$pixi_DOT_js$lib$environment$adapter");
"use strict";
exports.mapWebGLBlendModesToPixi = function(gl) {
const blendMap = {};
blendMap.normal = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
blendMap.add = [gl.ONE, gl.ONE];
blendMap.multiply = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
blendMap.screen = [gl.ONE, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
blendMap.none = [0, 0];
blendMap["normal-npm"] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
blendMap["add-npm"] = [gl.SRC_ALPHA, gl.ONE, gl.ONE, gl.ONE];
blendMap["screen-npm"] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
blendMap.erase = [gl.ZERO, gl.ONE_MINUS_SRC_ALPHA];
if (gl instanceof adapter.DOMAdapter.get().getWebGLRenderingContext()) {
const ext = gl.getExtension("EXT_blend_minmax");
ext && (blendMap.min = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, ext.MIN_EXT, ext.MIN_EXT], blendMap.max = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, ext.MAX_EXT, ext.MAX_EXT]);
} else {
blendMap.min = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, gl.MIN, gl.MIN], blendMap.max = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, gl.MAX, gl.MAX];
}
return blendMap;
};
};
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$rendering$renderers$gl$state$mapWebGLBlendModesToPixi.js.map