@@ -2445,116 +2445,6 @@ TEST_P(AiksTest, ReleasesTextureOnTeardown) {
2445
2445
" released." ;
2446
2446
}
2447
2447
2448
- // Regression test for https://github.com/flutter/flutter/issues/135441 .
2449
- TEST_P (AiksTest, VerticesGeometryUVPositionData) {
2450
- Canvas canvas;
2451
- Paint paint;
2452
- auto texture = CreateTextureForFixture (" table_mountain_nx.png" );
2453
-
2454
- paint.color_source = ColorSource::MakeImage (texture, Entity::TileMode::kClamp ,
2455
- Entity::TileMode::kClamp , {}, {});
2456
-
2457
- auto vertices = {Point (0 , 0 ), Point (texture->GetSize ().width , 0 ),
2458
- Point (0 , texture->GetSize ().height )};
2459
- std::vector<uint16_t > indices = {0u , 1u , 2u };
2460
- std::vector<Point > texture_coordinates = {};
2461
- std::vector<Color> vertex_colors = {};
2462
- auto geometry = std::make_shared<VerticesGeometry>(
2463
- vertices, indices, texture_coordinates, vertex_colors,
2464
- Rect::MakeLTRB (0 , 0 , 1 , 1 ), VerticesGeometry::VertexMode::kTriangleStrip );
2465
-
2466
- canvas.DrawVertices (geometry, BlendMode::kSourceOver , paint);
2467
- ASSERT_TRUE (OpenPlaygroundHere (canvas.EndRecordingAsPicture ()));
2468
- }
2469
-
2470
- // Regression test for https://github.com/flutter/flutter/issues/135441 .
2471
- TEST_P (AiksTest, VerticesGeometryUVPositionDataWithTranslate) {
2472
- Canvas canvas;
2473
- Paint paint;
2474
- auto texture = CreateTextureForFixture (" table_mountain_nx.png" );
2475
-
2476
- paint.color_source = ColorSource::MakeImage (
2477
- texture, Entity::TileMode::kClamp , Entity::TileMode::kClamp , {},
2478
- Matrix::MakeTranslation ({100.0 , 100.0 }));
2479
-
2480
- auto vertices = {Point (0 , 0 ), Point (texture->GetSize ().width , 0 ),
2481
- Point (0 , texture->GetSize ().height )};
2482
- std::vector<uint16_t > indices = {0u , 1u , 2u };
2483
- std::vector<Point > texture_coordinates = {};
2484
- std::vector<Color> vertex_colors = {};
2485
- auto geometry = std::make_shared<VerticesGeometry>(
2486
- vertices, indices, texture_coordinates, vertex_colors,
2487
- Rect::MakeLTRB (0 , 0 , 1 , 1 ), VerticesGeometry::VertexMode::kTriangleStrip );
2488
-
2489
- canvas.DrawVertices (geometry, BlendMode::kSourceOver , paint);
2490
- ASSERT_TRUE (OpenPlaygroundHere (canvas.EndRecordingAsPicture ()));
2491
- }
2492
-
2493
- // Regression test for https://github.com/flutter/flutter/issues/145707
2494
- TEST_P (AiksTest, VerticesGeometryColorUVPositionData) {
2495
- Canvas canvas;
2496
- Paint paint;
2497
- auto texture = CreateTextureForFixture (" table_mountain_nx.png" );
2498
-
2499
- paint.color_source =
2500
- ColorSource::MakeImage (texture, Entity::TileMode::kClamp ,
2501
- Entity::TileMode::kClamp , {}, Matrix ());
2502
-
2503
- auto vertices = {
2504
- Point (0 , 0 ),
2505
- Point (texture->GetSize ().width , 0 ),
2506
- Point (0 , texture->GetSize ().height ),
2507
- Point (texture->GetSize ().width , 0 ),
2508
- Point (0 , 0 ),
2509
- Point (texture->GetSize ().width , texture->GetSize ().height ),
2510
- };
2511
- std::vector<uint16_t > indices = {};
2512
- std::vector<Point > texture_coordinates = {};
2513
- std::vector<Color> vertex_colors = {
2514
- Color::Red ().WithAlpha (0.5 ), Color::Blue ().WithAlpha (0.5 ),
2515
- Color::Green ().WithAlpha (0.5 ), Color::Red ().WithAlpha (0.5 ),
2516
- Color::Blue ().WithAlpha (0.5 ), Color::Green ().WithAlpha (0.5 ),
2517
- };
2518
- auto geometry = std::make_shared<VerticesGeometry>(
2519
- vertices, indices, texture_coordinates, vertex_colors,
2520
- Rect::MakeLTRB (0 , 0 , 1 , 1 ), VerticesGeometry::VertexMode::kTriangles );
2521
-
2522
- canvas.DrawVertices (geometry, BlendMode::kDestinationOver , paint);
2523
- ASSERT_TRUE (OpenPlaygroundHere (canvas.EndRecordingAsPicture ()));
2524
- }
2525
-
2526
- TEST_P (AiksTest, VerticesGeometryColorUVPositionDataAdvancedBlend) {
2527
- Canvas canvas;
2528
- Paint paint;
2529
- auto texture = CreateTextureForFixture (" table_mountain_nx.png" );
2530
-
2531
- paint.color_source =
2532
- ColorSource::MakeImage (texture, Entity::TileMode::kClamp ,
2533
- Entity::TileMode::kClamp , {}, Matrix ());
2534
-
2535
- auto vertices = {
2536
- Point (0 , 0 ),
2537
- Point (texture->GetSize ().width , 0 ),
2538
- Point (0 , texture->GetSize ().height ),
2539
- Point (texture->GetSize ().width , 0 ),
2540
- Point (0 , 0 ),
2541
- Point (texture->GetSize ().width , texture->GetSize ().height ),
2542
- };
2543
- std::vector<uint16_t > indices = {};
2544
- std::vector<Point > texture_coordinates = {};
2545
- std::vector<Color> vertex_colors = {
2546
- Color::Red ().WithAlpha (0.5 ), Color::Blue ().WithAlpha (0.5 ),
2547
- Color::Green ().WithAlpha (0.5 ), Color::Red ().WithAlpha (0.5 ),
2548
- Color::Blue ().WithAlpha (0.5 ), Color::Green ().WithAlpha (0.5 ),
2549
- };
2550
- auto geometry = std::make_shared<VerticesGeometry>(
2551
- vertices, indices, texture_coordinates, vertex_colors,
2552
- Rect::MakeLTRB (0 , 0 , 1 , 1 ), VerticesGeometry::VertexMode::kTriangles );
2553
-
2554
- canvas.DrawVertices (geometry, BlendMode::kColorBurn , paint);
2555
- ASSERT_TRUE (OpenPlaygroundHere (canvas.EndRecordingAsPicture ()));
2556
- }
2557
-
2558
2448
TEST_P (AiksTest, MatrixImageFilterMagnify) {
2559
2449
Scalar scale = 2.0 ;
2560
2450
auto callback = [&](AiksContext& renderer) -> std::optional<Picture> {
0 commit comments