UNPKG

pixi.js

Version:

PixiJS — The HTML5 Creation Engine =============

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