Unverified Commit 38542d28 authored by wangying's avatar wangying Committed by GitHub

Add some debug properties to BackdropFilterLayer (#101101)

parent dacf3afe
......@@ -1897,7 +1897,7 @@ class ShaderMaskLayer extends ContainerLayer {
super.debugFillProperties(properties);
properties.add(DiagnosticsProperty<Shader>('shader', shader));
properties.add(DiagnosticsProperty<Rect>('maskRect', maskRect));
properties.add(DiagnosticsProperty<BlendMode>('blendMode', blendMode));
properties.add(EnumProperty<BlendMode>('blendMode', blendMode));
}
}
......@@ -1956,6 +1956,13 @@ class BackdropFilterLayer extends ContainerLayer {
addChildrenToScene(builder);
builder.pop();
}
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(DiagnosticsProperty<ui.ImageFilter>('filter', filter));
properties.add(EnumProperty<BlendMode>('blendMode', blendMode));
}
}
/// A composited layer that uses a physical model to producing lighting effects.
......
......@@ -365,6 +365,14 @@ void main() {
);
});
test('BackdropFilterLayer prints filter and blendMode in debug info', () {
final ImageFilter filter = ImageFilter.blur(sigmaX: 1.0, sigmaY: 1.0, tileMode: TileMode.repeated);
final BackdropFilterLayer layer = BackdropFilterLayer(filter: filter, blendMode: BlendMode.clear);
final List<String> info = _getDebugInfo(layer);
expect(info, contains(isBrowser ? 'filter: ImageFilter.blur(1, 1, TileMode.repeated)' : 'filter: ImageFilter.blur(1.0, 1.0, repeated)'));
expect(info, contains('blendMode: clear'));
});
test('PictureLayer prints picture, raster cache hints in debug info', () {
final PictureRecorder recorder = PictureRecorder();
final Canvas canvas = Canvas(recorder);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment