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