@@ -94,8 +94,6 @@ void _save() {
9494 layer . clipStack . save ( ) ;
9595 }
9696
97- readonly uiOffset [ ] _saveLayer_Points = new uiOffset [ 4 ] ;
98-
9997 void _saveLayer ( uiRect bounds , uiPaint paint ) {
10098 D . assert ( bounds . width > 0 ) ;
10199 D . assert ( bounds . height > 0 ) ;
@@ -127,30 +125,32 @@ void _saveLayer(uiRect bounds, uiPaint paint) {
127125 this . _currentLayer = layer ;
128126
129127 if ( paint . backdrop != null ) {
130- if ( paint . backdrop is _BlurImageFilter ) {
131- var filter = ( _BlurImageFilter ) paint . backdrop ;
128+ var points = new uiOffset [ 4 ] ;
129+
130+ if ( paint . backdrop is _uiBlurImageFilter ) {
131+ var filter = ( _uiBlurImageFilter ) paint . backdrop ;
132132 if ( ! ( filter . sigmaX == 0 && filter . sigmaY == 0 ) ) {
133- this . _saveLayer_Points [ 0 ] = bounds . topLeft ;
134- this . _saveLayer_Points [ 1 ] = bounds . bottomLeft ;
135- this . _saveLayer_Points [ 2 ] = bounds . bottomRight ;
136- this . _saveLayer_Points [ 3 ] = bounds . topRight ;
133+ points [ 0 ] = bounds . topLeft ;
134+ points [ 1 ] = bounds . bottomLeft ;
135+ points [ 2 ] = bounds . bottomRight ;
136+ points [ 3 ] = bounds . topRight ;
137137
138- state . matrix . Value . mapPoints ( this . _saveLayer_Points ) ;
138+ points = state . matrix . Value . mapPoints ( points ) ;
139139
140140 var parentBounds = parentLayer . layerBounds ;
141141 for ( int i = 0 ; i < 4 ; i ++ ) {
142- this . _saveLayer_Points [ i ] = new uiOffset (
143- ( this . _saveLayer_Points [ i ] . dx - parentBounds . left ) / parentBounds . width ,
144- ( this . _saveLayer_Points [ i ] . dy - parentBounds . top ) / parentBounds . height
142+ points [ i ] = new uiOffset (
143+ ( points [ i ] . dx - parentBounds . left ) / parentBounds . width ,
144+ ( points [ i ] . dy - parentBounds . top ) / parentBounds . height
145145 ) ;
146146 }
147147
148148 var mesh = ImageMeshGenerator . imageMesh (
149149 null ,
150- this . _saveLayer_Points [ 0 ] ,
151- this . _saveLayer_Points [ 1 ] ,
152- this . _saveLayer_Points [ 2 ] ,
153- this . _saveLayer_Points [ 3 ] ,
150+ points [ 0 ] ,
151+ points [ 1 ] ,
152+ points [ 2 ] ,
153+ points [ 3 ] ,
154154 bounds ) ;
155155 var renderDraw = CanvasShader . texRT ( layer , layer . layerPaint . Value , mesh , parentLayer ) ;
156156 layer . draws . Add ( renderDraw ) ;
@@ -160,35 +160,36 @@ void _saveLayer(uiRect bounds, uiPaint paint) {
160160 layer . draws . Add ( CanvasShader . texRT ( layer , paint , blurMesh , blurLayer ) ) ;
161161 }
162162 }
163- else if ( paint . backdrop is _MatrixImageFilter ) {
164- var filter = ( _MatrixImageFilter ) paint . backdrop ;
163+ else if ( paint . backdrop is _uiMatrixImageFilter ) {
164+ var filter = ( _uiMatrixImageFilter ) paint . backdrop ;
165165 if ( ! filter . transform . isIdentity ( ) ) {
166166 layer . filterMode = filter . filterMode ;
167167
168- this . _saveLayer_Points [ 0 ] = bounds . topLeft ;
169- this . _saveLayer_Points [ 1 ] = bounds . bottomLeft ;
170- this . _saveLayer_Points [ 2 ] = bounds . bottomRight ;
171- this . _saveLayer_Points [ 3 ] = bounds . topRight ;
172- state . matrix . Value . mapPoints ( this . _saveLayer_Points ) ;
168+ points [ 0 ] = bounds . topLeft ;
169+ points [ 1 ] = bounds . bottomLeft ;
170+ points [ 2 ] = bounds . bottomRight ;
171+ points [ 3 ] = bounds . topRight ;
172+
173+ points = state . matrix . Value . mapPoints ( points ) ;
173174
174175 var parentBounds = parentLayer . layerBounds ;
175176 for ( int i = 0 ; i < 4 ; i ++ ) {
176- this . _saveLayer_Points [ i ] = new uiOffset (
177- ( this . _saveLayer_Points [ i ] . dx - parentBounds . left ) / parentBounds . width ,
178- ( this . _saveLayer_Points [ i ] . dy - parentBounds . top ) / parentBounds . height
177+ points [ i ] = new uiOffset (
178+ ( points [ i ] . dx - parentBounds . left ) / parentBounds . width ,
179+ ( points [ i ] . dy - parentBounds . top ) / parentBounds . height
179180 ) ;
180181 }
181182
182183 var matrix = uiMatrix3 . makeTrans ( - bounds . left , - bounds . top ) ;
183- matrix . postConcat ( uiMatrix3 . fromMatrix3 ( filter . transform ) ) ;
184+ matrix . postConcat ( filter . transform ) ;
184185 matrix . postTranslate ( bounds . left , bounds . top ) ;
185186
186187 var mesh = ImageMeshGenerator . imageMesh (
187188 matrix ,
188- this . _saveLayer_Points [ 0 ] ,
189- this . _saveLayer_Points [ 1 ] ,
190- this . _saveLayer_Points [ 2 ] ,
191- this . _saveLayer_Points [ 3 ] ,
189+ points [ 0 ] ,
190+ points [ 1 ] ,
191+ points [ 2 ] ,
192+ points [ 3 ] ,
192193 bounds ) ;
193194 var renderDraw = CanvasShader . texRT ( layer , layer . layerPaint . Value , mesh , parentLayer ) ;
194195 layer . draws . Add ( renderDraw ) ;
0 commit comments