UNPKG

pixi.js

Version:

<p align="center"> <a href="https://pixijs.com" target="_blank" rel="noopener noreferrer"> <img height="150" src="https://files.pixijs.download/branding/pixijs-logo-transparent-dark.svg?v=1" alt="PixiJS logo"> </a> </p> <br/> <p align="center">

49 lines (46 loc) 1.17 kB
import { ExtensionType } from '../extensions/Extensions.mjs'; "use strict"; class FilterPipe { constructor(renderer) { this._renderer = renderer; } push(filterEffect, container, instructionSet) { const renderPipes = this._renderer.renderPipes; renderPipes.batch.break(instructionSet); instructionSet.add({ renderPipeId: "filter", canBundle: false, action: "pushFilter", container, filterEffect }); } pop(_filterEffect, _container, instructionSet) { this._renderer.renderPipes.batch.break(instructionSet); instructionSet.add({ renderPipeId: "filter", action: "popFilter", canBundle: false }); } execute(instruction) { if (instruction.action === "pushFilter") { this._renderer.filter.push(instruction); } else if (instruction.action === "popFilter") { this._renderer.filter.pop(); } } destroy() { this._renderer = null; } } FilterPipe.extension = { type: [ ExtensionType.WebGLPipes, ExtensionType.WebGPUPipes, ExtensionType.CanvasPipes ], name: "filter" }; export { FilterPipe }; //# sourceMappingURL=FilterPipe.mjs.map