@@ -99,7 +99,7 @@ void _save() {
9999 layer . clipStack . save ( ) ;
100100 }
101101
102- readonly uiOffset [ ] _saveLayer_Points = new uiOffset [ 4 ] ;
102+ static uiOffset [ ] _cachedPoints = new uiOffset [ 4 ] ;
103103
104104 void _saveLayer ( uiRect bounds , uiPaint paint ) {
105105 D . assert ( bounds . width > 0 ) ;
@@ -132,30 +132,31 @@ void _saveLayer(uiRect bounds, uiPaint paint) {
132132 this . _currentLayer = layer ;
133133
134134 if ( paint . backdrop != null ) {
135- if ( paint . backdrop is _BlurImageFilter ) {
136- var filter = ( _BlurImageFilter ) paint . backdrop ;
135+
136+ if ( paint . backdrop is _uiBlurImageFilter ) {
137+ var filter = ( _uiBlurImageFilter ) paint . backdrop ;
137138 if ( ! ( filter . sigmaX == 0 && filter . sigmaY == 0 ) ) {
138- this . _saveLayer_Points [ 0 ] = bounds . topLeft ;
139- this . _saveLayer_Points [ 1 ] = bounds . bottomLeft ;
140- this . _saveLayer_Points [ 2 ] = bounds . bottomRight ;
141- this . _saveLayer_Points [ 3 ] = bounds . topRight ;
139+ _cachedPoints [ 0 ] = bounds . topLeft ;
140+ _cachedPoints [ 1 ] = bounds . bottomLeft ;
141+ _cachedPoints [ 2 ] = bounds . bottomRight ;
142+ _cachedPoints [ 3 ] = bounds . topRight ;
142143
143- state . matrix . Value . mapPoints ( this . _saveLayer_Points ) ;
144+ state . matrix . Value . mapPoints ( ref _cachedPoints ) ;
144145
145146 var parentBounds = parentLayer . layerBounds ;
146147 for ( int i = 0 ; i < 4 ; i ++ ) {
147- this . _saveLayer_Points [ i ] = new uiOffset (
148- ( this . _saveLayer_Points [ i ] . dx - parentBounds . left ) / parentBounds . width ,
149- ( this . _saveLayer_Points [ i ] . dy - parentBounds . top ) / parentBounds . height
148+ _cachedPoints [ i ] = new uiOffset (
149+ ( _cachedPoints [ i ] . dx - parentBounds . left ) / parentBounds . width ,
150+ ( _cachedPoints [ i ] . dy - parentBounds . top ) / parentBounds . height
150151 ) ;
151152 }
152153
153154 var mesh = ImageMeshGenerator . imageMesh (
154155 null ,
155- this . _saveLayer_Points [ 0 ] ,
156- this . _saveLayer_Points [ 1 ] ,
157- this . _saveLayer_Points [ 2 ] ,
158- this . _saveLayer_Points [ 3 ] ,
156+ _cachedPoints [ 0 ] ,
157+ _cachedPoints [ 1 ] ,
158+ _cachedPoints [ 2 ] ,
159+ _cachedPoints [ 3 ] ,
159160 bounds ) ;
160161 var renderDraw = CanvasShader . texRT ( layer , layer . layerPaint . Value , mesh , parentLayer ) ;
161162 layer . draws . Add ( renderDraw ) ;
@@ -165,35 +166,36 @@ void _saveLayer(uiRect bounds, uiPaint paint) {
165166 layer . draws . Add ( CanvasShader . texRT ( layer , paint , blurMesh , blurLayer ) ) ;
166167 }
167168 }
168- else if ( paint . backdrop is _MatrixImageFilter ) {
169- var filter = ( _MatrixImageFilter ) paint . backdrop ;
169+ else if ( paint . backdrop is _uiMatrixImageFilter ) {
170+ var filter = ( _uiMatrixImageFilter ) paint . backdrop ;
170171 if ( ! filter . transform . isIdentity ( ) ) {
171172 layer . filterMode = filter . filterMode ;
172173
173- this . _saveLayer_Points [ 0 ] = bounds . topLeft ;
174- this . _saveLayer_Points [ 1 ] = bounds . bottomLeft ;
175- this . _saveLayer_Points [ 2 ] = bounds . bottomRight ;
176- this . _saveLayer_Points [ 3 ] = bounds . topRight ;
177- state . matrix . Value . mapPoints ( this . _saveLayer_Points ) ;
174+ _cachedPoints [ 0 ] = bounds . topLeft ;
175+ _cachedPoints [ 1 ] = bounds . bottomLeft ;
176+ _cachedPoints [ 2 ] = bounds . bottomRight ;
177+ _cachedPoints [ 3 ] = bounds . topRight ;
178+
179+ state . matrix . Value . mapPoints ( ref _cachedPoints ) ;
178180
179181 var parentBounds = parentLayer . layerBounds ;
180182 for ( int i = 0 ; i < 4 ; i ++ ) {
181- this . _saveLayer_Points [ i ] = new uiOffset (
182- ( this . _saveLayer_Points [ i ] . dx - parentBounds . left ) / parentBounds . width ,
183- ( this . _saveLayer_Points [ i ] . dy - parentBounds . top ) / parentBounds . height
183+ _cachedPoints [ i ] = new uiOffset (
184+ ( _cachedPoints [ i ] . dx - parentBounds . left ) / parentBounds . width ,
185+ ( _cachedPoints [ i ] . dy - parentBounds . top ) / parentBounds . height
184186 ) ;
185187 }
186188
187189 var matrix = uiMatrix3 . makeTrans ( - bounds . left , - bounds . top ) ;
188- matrix . postConcat ( uiMatrix3 . fromMatrix3 ( filter . transform ) ) ;
190+ matrix . postConcat ( filter . transform ) ;
189191 matrix . postTranslate ( bounds . left , bounds . top ) ;
190192
191193 var mesh = ImageMeshGenerator . imageMesh (
192194 matrix ,
193- this . _saveLayer_Points [ 0 ] ,
194- this . _saveLayer_Points [ 1 ] ,
195- this . _saveLayer_Points [ 2 ] ,
196- this . _saveLayer_Points [ 3 ] ,
195+ _cachedPoints [ 0 ] ,
196+ _cachedPoints [ 1 ] ,
197+ _cachedPoints [ 2 ] ,
198+ _cachedPoints [ 3 ] ,
197199 bounds ) ;
198200 var renderDraw = CanvasShader . texRT ( layer , layer . layerPaint . Value , mesh , parentLayer ) ;
199201 layer . draws . Add ( renderDraw ) ;
0 commit comments