@@ -94,7 +94,7 @@ void _save() {
94
94
layer . clipStack . save ( ) ;
95
95
}
96
96
97
- readonly uiOffset [ ] _saveLayer_Points = new uiOffset [ 4 ] ;
97
+ static uiOffset [ ] _cachedPoints = new uiOffset [ 4 ] ;
98
98
99
99
void _saveLayer ( uiRect bounds , uiPaint paint ) {
100
100
D . assert ( bounds . width > 0 ) ;
@@ -127,30 +127,31 @@ void _saveLayer(uiRect bounds, uiPaint paint) {
127
127
this . _currentLayer = layer ;
128
128
129
129
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 ;
132
133
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 ;
137
138
138
- state . matrix . Value . mapPoints ( this . _saveLayer_Points ) ;
139
+ state . matrix . Value . mapPoints ( ref _cachedPoints ) ;
139
140
140
141
var parentBounds = parentLayer . layerBounds ;
141
142
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
145
146
) ;
146
147
}
147
148
148
149
var mesh = ImageMeshGenerator . imageMesh (
149
150
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 ] ,
154
155
bounds ) ;
155
156
var renderDraw = CanvasShader . texRT ( layer , layer . layerPaint . Value , mesh , parentLayer ) ;
156
157
layer . draws . Add ( renderDraw ) ;
@@ -160,35 +161,36 @@ void _saveLayer(uiRect bounds, uiPaint paint) {
160
161
layer . draws . Add ( CanvasShader . texRT ( layer , paint , blurMesh , blurLayer ) ) ;
161
162
}
162
163
}
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 ;
165
166
if ( ! filter . transform . isIdentity ( ) ) {
166
167
layer . filterMode = filter . filterMode ;
167
168
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 ) ;
173
175
174
176
var parentBounds = parentLayer . layerBounds ;
175
177
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
179
181
) ;
180
182
}
181
183
182
184
var matrix = uiMatrix3 . makeTrans ( - bounds . left , - bounds . top ) ;
183
- matrix . postConcat ( uiMatrix3 . fromMatrix3 ( filter . transform ) ) ;
185
+ matrix . postConcat ( filter . transform ) ;
184
186
matrix . postTranslate ( bounds . left , bounds . top ) ;
185
187
186
188
var mesh = ImageMeshGenerator . imageMesh (
187
189
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 ] ,
192
194
bounds ) ;
193
195
var renderDraw = CanvasShader . texRT ( layer , layer . layerPaint . Value , mesh , parentLayer ) ;
194
196
layer . draws . Add ( renderDraw ) ;
0 commit comments