From c3b0ac6e5881f7808c7ad0f515de2c65c9cdf29d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E9=9F=AC?= Date: Tue, 29 Aug 2023 09:25:37 +0800 Subject: [PATCH] add: golden test --- .../canvas_mask_filter_golden_test.dart | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lib/web_ui/test/html/compositing/canvas_mask_filter_golden_test.dart b/lib/web_ui/test/html/compositing/canvas_mask_filter_golden_test.dart index 2dda8c5d48009..2f0c4183b888f 100644 --- a/lib/web_ui/test/html/compositing/canvas_mask_filter_golden_test.dart +++ b/lib/web_ui/test/html/compositing/canvas_mask_filter_golden_test.dart @@ -150,6 +150,32 @@ Future testMain() async { await canvasScreenshot(rc, 'mask_filter_transformed_$browser', region: screenRect); }); + + test('multiple MaskFilter.blur in $browser', () async { + const double screenWidth = 300.0; + const double screenHeight = 300.0; + const ui.Rect screenRect = + ui.Rect.fromLTWH(0, 0, screenWidth, screenHeight); + + ContextStateHandle.debugEmulateWebKitMaskFilter = isWebkit; + final RecordingCanvas rc = RecordingCanvas(screenRect); + + final SurfacePaint paint = SurfacePaint() + ..maskFilter = const ui.MaskFilter.blur(ui.BlurStyle.normal, 5); + rc.drawCircle(const ui.Offset(150, 150), 100, + paint..color = const ui.Color(0xFFC8C800)); + rc.drawCircle(const ui.Offset(150, 150), 50, + paint..color = const ui.Color(0xFFC800C8)); + rc.drawCircle( + const ui.Offset(150, 150), + 20, + paint + ..color = const ui.Color(0xFF00C8C8) + ..maskFilter = const ui.MaskFilter.blur(ui.BlurStyle.normal, 10)); + + await canvasScreenshot(rc, 'multiple_mask_filter_$browser', + region: screenRect); + }); } testMaskFilterBlur();