Skip to content

Commit

Permalink
add: golden test
Browse files Browse the repository at this point in the history
  • Loading branch information
金韬 committed Aug 29, 2023
1 parent efbd4ba commit c3b0ac6
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,32 @@ Future<void> 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();
Expand Down

0 comments on commit c3b0ac6

Please sign in to comment.