@@ -31,7 +31,7 @@ void main() async {
3131 try {
3232 sceneElement.append (engineCanvas.rootElement);
3333 html.document.body.append (sceneElement);
34- await matchGoldenFile ('$fileName .png' , region: region, maxDiffRate: 0.02 );
34+ await matchGoldenFile ('$fileName .png' , region: region, maxDiffRate: 0.2 );
3535 } finally {
3636 // The page is reused across tests, so remove the element after taking the
3737 // Scuba screenshot.
@@ -100,6 +100,19 @@ void main() async {
100100 await _checkScreenshot (rc, 'draw_image_rect_with_source' );
101101 });
102102
103+ test ('Paints image with source and destination and round clip' , () async {
104+ final RecordingCanvas rc =
105+ RecordingCanvas (const Rect .fromLTRB (0 , 0 , 400 , 300 ));
106+ Image testImage = createTestImage ();
107+ double testWidth = testImage.width.toDouble ();
108+ double testHeight = testImage.height.toDouble ();
109+ rc.save ();
110+ rc.clipRRect (RRect .fromLTRBR (100 , 30 , 2 * testWidth, 2 * testHeight, Radius .circular (16 )));
111+ rc.drawImageRect (testImage, Rect .fromLTRB (testWidth / 2 , 0 , testWidth, testHeight),
112+ Rect .fromLTRB (100 , 30 , 2 * testWidth, 2 * testHeight), new Paint ());
113+ await _checkScreenshot (rc, 'draw_image_rect_with_source_and_clip' );
114+ });
115+
103116 test ('Paints image with transform using source and destination' , () async {
104117 final RecordingCanvas rc =
105118 RecordingCanvas (const Rect .fromLTRB (0 , 0 , 400 , 300 ));
0 commit comments