@@ -3,10 +3,8 @@ import {
3
3
ChangeDetectionStrategy ,
4
4
Component ,
5
5
ElementRef ,
6
- Injector ,
7
6
computed ,
8
7
effect ,
9
- inject ,
10
8
input ,
11
9
viewChild ,
12
10
} from '@angular/core' ;
@@ -66,7 +64,6 @@ function isConvolution(effect: Effect) {
66
64
export class NgtpEffectComposer {
67
65
options = input ( defaultOptions , { transform : mergeInputs ( defaultOptions ) } ) ;
68
66
69
- private injector = inject ( Injector ) ;
70
67
private store = injectStore ( ) ;
71
68
72
69
private depthBuffer = pick ( this . options , 'depthBuffer' ) ;
@@ -157,7 +154,7 @@ export class NgtpEffectComposer {
157
154
} ) ;
158
155
159
156
effect ( ( ) => {
160
- const [ { composer } , width , height ] = [ this . composerData ( ) , this . store . size . width ( ) , this . store . size . height ( ) ] ;
157
+ const [ composer , width , height ] = [ this . effectComposer ( ) , this . store . size . width ( ) , this . store . size . height ( ) ] ;
161
158
if ( composer ) {
162
159
composer . setSize ( width , height ) ;
163
160
}
@@ -213,29 +210,23 @@ export class NgtpEffectComposer {
213
210
} ) ;
214
211
} ) ;
215
212
216
- effect ( ( onCleanup ) => {
217
- const priority = this . priority ( ) ;
218
-
219
- const sub = injectBeforeRender (
220
- ( { delta } ) => {
221
- const [ { composer } , { enabled, autoClear, stencilBuffer } , gl ] = [
222
- this . composerData ( ) ,
223
- this . options ( ) ,
224
- this . store . snapshot . gl ,
225
- ] ;
226
-
227
- if ( enabled ) {
228
- const currentAutoClear = gl . autoClear ;
229
- gl . autoClear = autoClear ;
230
- if ( stencilBuffer && ! autoClear ) gl . clearStencil ( ) ;
231
- composer . render ( delta ) ;
232
- gl . autoClear = currentAutoClear ;
233
- }
234
- } ,
235
- { injector : this . injector , priority } ,
236
- ) ;
237
-
238
- onCleanup ( ( ) => sub ( ) ) ;
239
- } ) ;
213
+ injectBeforeRender (
214
+ ( { delta } ) => {
215
+ const [ composer , { enabled, autoClear, stencilBuffer } , gl ] = [
216
+ this . effectComposer ( ) ,
217
+ this . options ( ) ,
218
+ this . store . snapshot . gl ,
219
+ ] ;
220
+
221
+ if ( enabled ) {
222
+ const currentAutoClear = gl . autoClear ;
223
+ gl . autoClear = autoClear ;
224
+ if ( stencilBuffer && ! autoClear ) gl . clearStencil ( ) ;
225
+ composer . render ( delta ) ;
226
+ gl . autoClear = currentAutoClear ;
227
+ }
228
+ } ,
229
+ { priority : this . priority } ,
230
+ ) ;
240
231
}
241
232
}
0 commit comments