@@ -936,6 +936,7 @@ class ContextStateHandle {
936
936
}
937
937
938
938
ui.MaskFilter ? _currentFilter;
939
+ String ? _currentFilterCss;
939
940
SurfacePaintData ? _lastUsedPaint;
940
941
941
942
/// Currently active shader bounds.
@@ -1005,19 +1006,20 @@ class ContextStateHandle {
1005
1006
}
1006
1007
1007
1008
final ui.MaskFilter ? maskFilter = paint.maskFilter;
1008
- if (! _renderMaskFilterForWebkit) {
1009
- if (_currentFilter != maskFilter) {
1010
- _currentFilter = maskFilter;
1011
- context.filter = maskFilterToCanvasFilter (maskFilter);
1012
- }
1013
- } else {
1014
- // WebKit does not support the `filter` property. Instead we apply a
1015
- // shadow to the shape of the same color as the paint and the same blur
1016
- // as the mask filter.
1017
- //
1018
- // Note that on WebKit the cached value of _currentFilter is not useful.
1019
- // Instead we destructure it into the shadow properties and cache those.
1020
- if (maskFilter != null ) {
1009
+ if (maskFilter != null ) {
1010
+ if (! _renderMaskFilterForWebkit) {
1011
+ if (_currentFilter != maskFilter) {
1012
+ _currentFilter = maskFilter;
1013
+ _currentFilterCss = maskFilterToCanvasFilter (maskFilter);
1014
+ }
1015
+ context.filter = _currentFilterCss;
1016
+ } else {
1017
+ // WebKit does not support the `filter` property. Instead we apply a
1018
+ // shadow to the shape of the same color as the paint and the same blur
1019
+ // as the mask filter.
1020
+ //
1021
+ // Note that on WebKit the cached value of _currentFilter is not useful.
1022
+ // Instead we destructure it into the shadow properties and cache those.
1021
1023
context.save ();
1022
1024
context.shadowBlur = convertSigmaToRadius (maskFilter.webOnlySigma);
1023
1025
// Shadow color must be fully opaque.
0 commit comments