@@ -94,7 +94,7 @@ void _save() {
9494 layer . clipStack . save ( ) ;
9595 }
9696
97- readonly uiOffset [ ] _saveLayer_Points = new uiOffset [ 4 ] ;
97+ static uiOffset [ ] _cachedPoints = new uiOffset [ 4 ] ;
9898
9999 void _saveLayer ( uiRect bounds , uiPaint paint ) {
100100 D . assert ( bounds . width > 0 ) ;
@@ -127,30 +127,31 @@ void _saveLayer(uiRect bounds, uiPaint paint) {
127127 this . _currentLayer = layer ;
128128
129129 if ( paint . backdrop != null ) {
130- if ( paint . backdrop is _BlurImageFilter ) {
131- var filter = ( _BlurImageFilter ) paint . backdrop ;
130+
131+ if ( paint . backdrop is _uiBlurImageFilter ) {
132+ var filter = ( _uiBlurImageFilter ) paint . backdrop ;
132133 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 ;
134+ _cachedPoints [ 0 ] = bounds . topLeft ;
135+ _cachedPoints [ 1 ] = bounds . bottomLeft ;
136+ _cachedPoints [ 2 ] = bounds . bottomRight ;
137+ _cachedPoints [ 3 ] = bounds . topRight ;
137138
138- state . matrix . Value . mapPoints ( this . _saveLayer_Points ) ;
139+ state . matrix . Value . mapPoints ( ref _cachedPoints ) ;
139140
140141 var parentBounds = parentLayer . layerBounds ;
141142 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
143+ _cachedPoints [ i ] = new uiOffset (
144+ ( _cachedPoints [ i ] . dx - parentBounds . left ) / parentBounds . width ,
145+ ( _cachedPoints [ i ] . dy - parentBounds . top ) / parentBounds . height
145146 ) ;
146147 }
147148
148149 var mesh = ImageMeshGenerator . imageMesh (
149150 null ,
150- this . _saveLayer_Points [ 0 ] ,
151- this . _saveLayer_Points [ 1 ] ,
152- this . _saveLayer_Points [ 2 ] ,
153- this . _saveLayer_Points [ 3 ] ,
151+ _cachedPoints [ 0 ] ,
152+ _cachedPoints [ 1 ] ,
153+ _cachedPoints [ 2 ] ,
154+ _cachedPoints [ 3 ] ,
154155 bounds ) ;
155156 var renderDraw = CanvasShader . texRT ( layer , layer . layerPaint . Value , mesh , parentLayer ) ;
156157 layer . draws . Add ( renderDraw ) ;
@@ -160,35 +161,36 @@ void _saveLayer(uiRect bounds, uiPaint paint) {
160161 layer . draws . Add ( CanvasShader . texRT ( layer , paint , blurMesh , blurLayer ) ) ;
161162 }
162163 }
163- else if ( paint . backdrop is _MatrixImageFilter ) {
164- var filter = ( _MatrixImageFilter ) paint . backdrop ;
164+ else if ( paint . backdrop is _uiMatrixImageFilter ) {
165+ var filter = ( _uiMatrixImageFilter ) paint . backdrop ;
165166 if ( ! filter . transform . isIdentity ( ) ) {
166167 layer . filterMode = filter . filterMode ;
167168
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 ) ;
169+ _cachedPoints [ 0 ] = bounds . topLeft ;
170+ _cachedPoints [ 1 ] = bounds . bottomLeft ;
171+ _cachedPoints [ 2 ] = bounds . bottomRight ;
172+ _cachedPoints [ 3 ] = bounds . topRight ;
173+
174+ state . matrix . Value . mapPoints ( ref _cachedPoints ) ;
173175
174176 var parentBounds = parentLayer . layerBounds ;
175177 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
178+ _cachedPoints [ i ] = new uiOffset (
179+ ( _cachedPoints [ i ] . dx - parentBounds . left ) / parentBounds . width ,
180+ ( _cachedPoints [ i ] . dy - parentBounds . top ) / parentBounds . height
179181 ) ;
180182 }
181183
182184 var matrix = uiMatrix3 . makeTrans ( - bounds . left , - bounds . top ) ;
183- matrix . postConcat ( uiMatrix3 . fromMatrix3 ( filter . transform ) ) ;
185+ matrix . postConcat ( filter . transform ) ;
184186 matrix . postTranslate ( bounds . left , bounds . top ) ;
185187
186188 var mesh = ImageMeshGenerator . imageMesh (
187189 matrix ,
188- this . _saveLayer_Points [ 0 ] ,
189- this . _saveLayer_Points [ 1 ] ,
190- this . _saveLayer_Points [ 2 ] ,
191- this . _saveLayer_Points [ 3 ] ,
190+ _cachedPoints [ 0 ] ,
191+ _cachedPoints [ 1 ] ,
192+ _cachedPoints [ 2 ] ,
193+ _cachedPoints [ 3 ] ,
192194 bounds ) ;
193195 var renderDraw = CanvasShader . texRT ( layer , layer . layerPaint . Value , mesh , parentLayer ) ;
194196 layer . draws . Add ( renderDraw ) ;
0 commit comments