UNPKG

850 BJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, '__esModule', { value: true });
4
5class AbstractMaskSystem {
6 constructor(renderer) {
7 this.renderer = renderer;
8 this.maskStack = [];
9 this.glConst = 0;
10 }
11 getStackLength() {
12 return this.maskStack.length;
13 }
14 setMaskStack(maskStack) {
15 const { gl } = this.renderer;
16 const curStackLen = this.getStackLength();
17 this.maskStack = maskStack;
18 const newStackLen = this.getStackLength();
19 if (newStackLen !== curStackLen) {
20 if (newStackLen === 0) {
21 gl.disable(this.glConst);
22 } else {
23 gl.enable(this.glConst);
24 this._useCurrent();
25 }
26 }
27 }
28 _useCurrent() {
29 }
30 destroy() {
31 this.renderer = null;
32 this.maskStack = null;
33 }
34}
35
36exports.AbstractMaskSystem = AbstractMaskSystem;
37//# sourceMappingURL=AbstractMaskSystem.js.map