1 line
1.3 KiB
Plaintext
1 line
1.3 KiB
Plaintext
{"version":3,"file":"getAdjustedBlendModeBlend.mjs","sources":["../../../../../src/rendering/renderers/shared/state/getAdjustedBlendModeBlend.ts"],"sourcesContent":["import { type BLEND_MODES, BLEND_TO_NPM } from './const';\n\nimport type { TextureSource } from '../texture/sources/TextureSource';\n\n/**\n * Adjusts a blend mode for the current alpha mode. Returns the blend mode that works with that format.\n * eg 'normal' blend mode will return 'normal-npm' when rendering with premultiplied alpha.\n * and 'normal' if the texture is already premultiplied (the default)\n * @param blendMode - The blend mode to get the adjusted blend mode for.\n * @param textureSource - The texture to test the format of.\n * @returns - the blend mode that should be used to render this texture correctly based on its alphaMode\n */\nexport function getAdjustedBlendModeBlend(blendMode: BLEND_MODES, textureSource: TextureSource): BLEND_MODES\n{\n if (textureSource.alphaMode === 'no-premultiply-alpha')\n {\n return (BLEND_TO_NPM[blendMode as keyof typeof BLEND_TO_NPM] || blendMode) as BLEND_MODES;\n }\n\n return blendMode;\n}\n"],"names":[],"mappings":";;;AAYgB,SAAA,yBAAA,CAA0B,WAAwB,aAClE,EAAA;AACI,EAAI,IAAA,aAAA,CAAc,cAAc,sBAChC,EAAA;AACI,IAAQ,OAAA,YAAA,CAAa,SAAsC,CAAK,IAAA,SAAA,CAAA;AAAA,GACpE;AAEA,EAAO,OAAA,SAAA,CAAA;AACX;;;;"} |