@pixi/core
Version:
Core PixiJS
36 lines (35 loc) • 1.05 kB
JavaScript
"use strict";
class AbstractMaskSystem {
/**
* @param renderer - The renderer this System works for.
*/
constructor(renderer) {
this.renderer = renderer, this.maskStack = [], this.glConst = 0;
}
/** Gets count of masks of certain type. */
getStackLength() {
return this.maskStack.length;
}
/**
* Changes the mask stack that is used by this System.
* @param {PIXI.MaskData[]} maskStack - The mask stack
*/
setMaskStack(maskStack) {
const { gl } = this.renderer, curStackLen = this.getStackLength();
this.maskStack = maskStack;
const newStackLen = this.getStackLength();
newStackLen !== curStackLen && (newStackLen === 0 ? gl.disable(this.glConst) : (gl.enable(this.glConst), this._useCurrent()));
}
/**
* Setup renderer to use the current mask data.
* @private
*/
_useCurrent() {
}
/** Destroys the mask stack. */
destroy() {
this.renderer = null, this.maskStack = null;
}
}
exports.AbstractMaskSystem = AbstractMaskSystem;
//# sourceMappingURL=AbstractMaskSystem.js.map