{"version":3,"file":"getTestContext.mjs","sources":["../../../../../../src/rendering/renderers/gl/shader/program/getTestContext.ts"],"sourcesContent":["import { DOMAdapter } from '../../../../../environment/adapter';\n\nimport type { GlRenderingContext } from '../../context/GlRenderingContext';\n\nlet context: GlRenderingContext;\n\n/**\n * returns a little WebGL context to use for program inspection.\n * @private\n * @returns {WebGLRenderingContext} a gl context to test with\n */\nexport function getTestContext(): GlRenderingContext\n{\n    if (!context || context?.isContextLost())\n    {\n        const canvas = DOMAdapter.get().createCanvas();\n\n        context = canvas.getContext('webgl', {}) as GlRenderingContext;\n    }\n\n    return context;\n}\n"],"names":[],"mappings":";;;AAIA,IAAI,OAAA;AAOG,SAAS,cAAA,GAChB;AACI,EAAA,IAAI,CAAC,OAAA,IAAW,OAAA,EAAS,aAAA,EAAc,EACvC;AACI,IAAA,MAAM,MAAA,GAAS,UAAA,CAAW,GAAA,EAAI,CAAE,YAAA,EAAa;AAE7C,IAAA,OAAA,GAAU,MAAA,CAAO,UAAA,CAAW,OAAA,EAAS,EAAE,CAAA;AAAA,EAC3C;AAEA,EAAA,OAAO,OAAA;AACX;;;;"}