1 | "use strict";
|
2 | class AbstractMaskSystem {
|
3 | |
4 |
|
5 |
|
6 | constructor(renderer) {
|
7 | this.renderer = renderer, this.maskStack = [], this.glConst = 0;
|
8 | }
|
9 |
|
10 | getStackLength() {
|
11 | return this.maskStack.length;
|
12 | }
|
13 | |
14 |
|
15 |
|
16 |
|
17 | setMaskStack(maskStack) {
|
18 | const { gl } = this.renderer, curStackLen = this.getStackLength();
|
19 | this.maskStack = maskStack;
|
20 | const newStackLen = this.getStackLength();
|
21 | newStackLen !== curStackLen && (newStackLen === 0 ? gl.disable(this.glConst) : (gl.enable(this.glConst), this._useCurrent()));
|
22 | }
|
23 | |
24 |
|
25 |
|
26 |
|
27 | _useCurrent() {
|
28 | }
|
29 |
|
30 | destroy() {
|
31 | this.renderer = null, this.maskStack = null;
|
32 | }
|
33 | }
|
34 | exports.AbstractMaskSystem = AbstractMaskSystem;
|
35 |
|