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