@@ -206,12 +206,23 @@ void CanRenderTiledTexture(AiksTest* aiks_test,
206206 canvas.DrawRect (Rect::MakeXYWH (0 , 0 , 600 , 600 ), paint);
207207 }
208208
209- // Should not change the image.
210- PathBuilder path_builder;
211- path_builder.AddCircle ({150 , 150 }, 150 );
212- path_builder.AddRoundedRect (Rect::MakeLTRB (300 , 300 , 600 , 600 ), 10 );
213- paint.style = Paint::Style::kFill ;
214- canvas.DrawPath (path_builder.TakePath (), paint);
209+ {
210+ // Should not change the image.
211+ PathBuilder path_builder;
212+ path_builder.AddCircle ({150 , 150 }, 150 );
213+ path_builder.AddRoundedRect (Rect::MakeLTRB (300 , 300 , 600 , 600 ), 10 );
214+ paint.style = Paint::Style::kFill ;
215+ canvas.DrawPath (path_builder.TakePath (), paint);
216+ }
217+
218+ {
219+ // Should not change the image. Tests the Convex short-cut code.
220+ PathBuilder path_builder;
221+ path_builder.AddCircle ({150 , 450 }, 150 );
222+ path_builder.SetConvexity (Convexity::kConvex );
223+ paint.style = Paint::Style::kFill ;
224+ canvas.DrawPath (path_builder.TakePath (), paint);
225+ }
215226
216227 ASSERT_TRUE (aiks_test->OpenPlaygroundHere (canvas.EndRecordingAsPicture ()));
217228}
@@ -3744,6 +3755,29 @@ TEST_P(AiksTest, VerticesGeometryUVPositionData) {
37443755 ASSERT_TRUE (OpenPlaygroundHere (canvas.EndRecordingAsPicture ()));
37453756}
37463757
3758+ // Regression test for https://github.com/flutter/flutter/issues/135441 .
3759+ TEST_P (AiksTest, VerticesGeometryUVPositionDataWithTranslate) {
3760+ Canvas canvas;
3761+ Paint paint;
3762+ auto texture = CreateTextureForFixture (" table_mountain_nx.png" );
3763+
3764+ paint.color_source = ColorSource::MakeImage (
3765+ texture, Entity::TileMode::kClamp , Entity::TileMode::kClamp , {},
3766+ Matrix::MakeTranslation ({100.0 , 100.0 }));
3767+
3768+ auto vertices = {Point (0 , 0 ), Point (texture->GetSize ().width , 0 ),
3769+ Point (0 , texture->GetSize ().height )};
3770+ std::vector<uint16_t > indices = {0u , 1u , 2u };
3771+ std::vector<Point> texture_coordinates = {};
3772+ std::vector<Color> vertex_colors = {};
3773+ auto geometry = std::make_shared<VerticesGeometry>(
3774+ vertices, indices, texture_coordinates, vertex_colors,
3775+ Rect::MakeLTRB (0 , 0 , 1 , 1 ), VerticesGeometry::VertexMode::kTriangleStrip );
3776+
3777+ canvas.DrawVertices (geometry, BlendMode::kSourceOver , paint);
3778+ ASSERT_TRUE (OpenPlaygroundHere (canvas.EndRecordingAsPicture ()));
3779+ }
3780+
37473781TEST_P (AiksTest, ClearBlendWithBlur) {
37483782 Canvas canvas;
37493783 Paint white;
0 commit comments