{"version":3,"file":"CullerPlugin.mjs","sources":["../../src/culling/CullerPlugin.ts"],"sourcesContent":["import { ExtensionType } from '../extensions/Extensions';\nimport { Culler } from './Culler';\n\nimport type { ExtensionMetadata } from '../extensions/Extensions';\nimport type { Renderer } from '../rendering/renderers/types';\nimport type { Container } from '../scene/container/Container';\n\n/**\n * An {@link app.Application} plugin that will automatically cull your stage using the renderers screen size.\n * @example\n * import { extensions, CullerPlugin } from 'pixi.js';\n *\n * extensions.add(CullerPlugin);\n * @memberof app\n * @see {@link scene.Culler}\n */\nexport class CullerPlugin\n{\n    /** @ignore */\n    public static extension: ExtensionMetadata = {\n        priority: 10,\n        type: ExtensionType.Application,\n        name: 'culler',\n    };\n\n    public static renderer: Renderer;\n    public static stage: Container;\n    public static render: () => void;\n    private static _renderRef: () => void;\n\n    public static init(): void\n    {\n        this._renderRef = this.render.bind(this);\n\n        this.render = (): void =>\n        {\n            Culler.shared.cull(this.stage, this.renderer.screen);\n            this.renderer.render({ container: this.stage });\n        };\n    }\n\n    public static destroy(): void\n    {\n        this.render = this._renderRef;\n    }\n}\n"],"names":[],"mappings":";;;;AAgBO,MAAM,YACb,CAAA;AAAA,EAaI,OAAc,IACd,GAAA;AACI,IAAA,IAAA,CAAK,UAAa,GAAA,IAAA,CAAK,MAAO,CAAA,IAAA,CAAK,IAAI,CAAA,CAAA;AAEvC,IAAA,IAAA,CAAK,SAAS,MACd;AACI,MAAA,MAAA,CAAO,OAAO,IAAK,CAAA,IAAA,CAAK,KAAO,EAAA,IAAA,CAAK,SAAS,MAAM,CAAA,CAAA;AACnD,MAAA,IAAA,CAAK,SAAS,MAAO,CAAA,EAAE,SAAW,EAAA,IAAA,CAAK,OAAO,CAAA,CAAA;AAAA,KAClD,CAAA;AAAA,GACJ;AAAA,EAEA,OAAc,OACd,GAAA;AACI,IAAA,IAAA,CAAK,SAAS,IAAK,CAAA,UAAA,CAAA;AAAA,GACvB;AACJ,CAAA;AAAA;AA7Ba,YAAA,CAGK,SAA+B,GAAA;AAAA,EACzC,QAAU,EAAA,EAAA;AAAA,EACV,MAAM,aAAc,CAAA,WAAA;AAAA,EACpB,IAAM,EAAA,QAAA;AACV,CAAA;;;;"}