@@ -45,7 +45,7 @@ TEST_F(AiksTest, CanRenderColoredRect) {
4545 paint.color = Color::Red ();
4646 canvas.DrawPath (PathBuilder{}
4747 .AddRect (Rect::MakeXYWH (100.0 , 100.0 , 100.0 , 100.0 ))
48- .CreatePath (),
48+ .TakePath (),
4949 paint);
5050 // ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
5151}
@@ -81,7 +81,7 @@ TEST_F(AiksTest, CanRenderStrokes) {
8181 paint.color = Color::Red ();
8282 paint.stroke_width = 20.0 ;
8383 paint.style = Paint::Style::kStroke ;
84- canvas.DrawPath (PathBuilder{}.AddLine ({200 , 100 }, {800 , 100 }).CreatePath (),
84+ canvas.DrawPath (PathBuilder{}.AddLine ({200 , 100 }, {800 , 100 }).TakePath (),
8585 paint);
8686 // ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
8787}
@@ -92,7 +92,7 @@ TEST_F(AiksTest, CanRenderCurvedStrokes) {
9292 paint.color = Color::Red ();
9393 paint.stroke_width = 25.0 ;
9494 paint.style = Paint::Style::kStroke ;
95- canvas.DrawPath (PathBuilder{}.AddCircle ({500 , 500 }, 250 ).CreatePath (), paint);
95+ canvas.DrawPath (PathBuilder{}.AddCircle ({500 , 500 }, 250 ).TakePath (), paint);
9696 ASSERT_TRUE (OpenPlaygroundHere (canvas.EndRecordingAsPicture ()));
9797}
9898
@@ -101,8 +101,8 @@ TEST_F(AiksTest, CanRenderClips) {
101101 Paint paint;
102102 paint.color = Color::Fuchsia ();
103103 canvas.ClipPath (
104- PathBuilder{}.AddRect (Rect::MakeXYWH (0 , 0 , 500 , 500 )).CreatePath ());
105- canvas.DrawPath (PathBuilder{}.AddCircle ({500 , 500 }, 250 ).CreatePath (), paint);
104+ PathBuilder{}.AddRect (Rect::MakeXYWH (0 , 0 , 500 , 500 )).TakePath ());
105+ canvas.DrawPath (PathBuilder{}.AddCircle ({500 , 500 }, 250 ).TakePath (), paint);
106106 ASSERT_TRUE (OpenPlaygroundHere (canvas.EndRecordingAsPicture ()));
107107}
108108
@@ -236,14 +236,39 @@ TEST_F(AiksTest, CanRenderRoundedRectWithNonUniformRadii) {
236236 radii.bottom_right = {50 , 25 };
237237 radii.bottom_left = {25 , 50 };
238238
239- auto path = PathBuilder{}
240- .AddRoundedRect (Rect{100 , 100 , 500 , 500 }, radii)
241- .CreatePath ();
239+ auto path =
240+ PathBuilder{}.AddRoundedRect (Rect{100 , 100 , 500 , 500 }, radii).TakePath ();
242241
243242 canvas.DrawPath (path, paint);
244243
245244 ASSERT_TRUE (OpenPlaygroundHere (canvas.EndRecordingAsPicture ()));
246245}
247246
247+ TEST_F (AiksTest, CanRenderDifferencePaths) {
248+ Canvas canvas;
249+
250+ Paint paint;
251+ paint.color = Color::Red ();
252+
253+ PathBuilder builder;
254+
255+ PathBuilder::RoundingRadii radii;
256+ radii.top_left = {50 , 25 };
257+ radii.top_right = {25 , 50 };
258+ radii.bottom_right = {50 , 25 };
259+ radii.bottom_left = {25 , 50 };
260+
261+ builder.AddRoundedRect ({100 , 100 , 200 , 200 }, radii);
262+ builder.AddCircle ({200 , 200 }, 50 );
263+ auto path = builder.TakePath (FillType::kOdd );
264+
265+ canvas.DrawImage (
266+ std::make_shared<Image>(CreateTextureForFixture (" boston.jpg" )), {10 , 10 },
267+ Paint{});
268+ canvas.DrawPath (std::move (path), paint);
269+
270+ ASSERT_TRUE (OpenPlaygroundHere (canvas.EndRecordingAsPicture ()));
271+ }
272+
248273} // namespace testing
249274} // namespace impeller
0 commit comments