/
githubmirror
/
pixijs
Обзор
Документация
Войти
/
githubmirror
/
pixijs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
src/filters/FilterPipe.ts
71 строка
2 KB
Zyie
chore: documentation overhaul with typedoc (#11423)
19 май 2025, 11:44
Не верифицирован
19 май 2025, 11:44
34926f0
Код
Авторство
О чём код?
import { ExtensionType } from '../extensions/Extensions'; import type { InstructionSet } from '../rendering/renderers/shared/instructions/InstructionSet'; import type { InstructionPipe } from '../rendering/renderers/shared/instructions/RenderPipe'; import type { Renderer } from '../rendering/renderers/types'; import type { Container } from '../scene/container/Container'; import type { Effect } from '../scene/container/Effect'; import type { FilterInstruction } from './FilterSystem'; /** @internal */ export class FilterPipe implements InstructionPipe<FilterInstruction> { public static extension = { type: [ ExtensionType.WebGLPipes, ExtensionType.WebGPUPipes, ExtensionType.CanvasPipes, ], name: 'filter', } as const; private _renderer: Renderer; constructor(renderer: Renderer) { this._renderer = renderer; } public push(filterEffect: Effect, container: Container, instructionSet: InstructionSet): void { const renderPipes = this._renderer.renderPipes; renderPipes.batch.break(instructionSet); instructionSet.add({ renderPipeId: 'filter', canBundle: false, action: 'pushFilter', container, filterEffect, } as FilterInstruction); } public pop(_filterEffect: Effect, _container: Container, instructionSet: InstructionSet): void { this._renderer.renderPipes.batch.break(instructionSet); instructionSet.add({ renderPipeId: 'filter', action: 'popFilter', canBundle: false, }); } public execute(instruction: FilterInstruction) { if (instruction.action === 'pushFilter') { this._renderer.filter.push(instruction); } else if (instruction.action === 'popFilter') { this._renderer.filter.pop(); } } public destroy(): void { this._renderer = null; } }