@@ -2264,6 +2264,74 @@ TEST_P(AiksTest, FilledEllipsesRenderCorrectly) {
22642264 ASSERT_TRUE (OpenPlaygroundHere (canvas.EndRecordingAsPicture ()));
22652265}
22662266
2267+ TEST_P (AiksTest, FilledRoundRectsRenderCorrectly) {
2268+ Canvas canvas;
2269+ canvas.Scale (GetContentScale ());
2270+ Paint paint;
2271+ const int color_count = 3 ;
2272+ Color colors[color_count] = {
2273+ Color::Blue (),
2274+ Color::Green (),
2275+ Color::Crimson (),
2276+ };
2277+
2278+ paint.color = Color::White ();
2279+ canvas.DrawPaint (paint);
2280+
2281+ int c_index = 0 ;
2282+ for (int i = 0 ; i < 4 ; i++) {
2283+ for (int j = 0 ; j < 4 ; j++) {
2284+ paint.color = colors[(c_index++) % color_count];
2285+ canvas.DrawRRect (Rect::MakeXYWH (i * 100 + 10 , j * 100 + 20 , 80 , 80 ),
2286+ Size (i * 5 + 10 , j * 5 + 10 ), paint);
2287+ }
2288+ }
2289+
2290+ std::vector<Color> gradient_colors = {
2291+ Color{0x1f / 255.0 , 0.0 , 0x5c / 255.0 , 1.0 },
2292+ Color{0x5b / 255.0 , 0.0 , 0x60 / 255.0 , 1.0 },
2293+ Color{0x87 / 255.0 , 0x01 / 255.0 , 0x60 / 255.0 , 1.0 },
2294+ Color{0xac / 255.0 , 0x25 / 255.0 , 0x53 / 255.0 , 1.0 },
2295+ Color{0xe1 / 255.0 , 0x6b / 255.0 , 0x5c / 255.0 , 1.0 },
2296+ Color{0xf3 / 255.0 , 0x90 / 255.0 , 0x60 / 255.0 , 1.0 },
2297+ Color{0xff / 255.0 , 0xb5 / 255.0 , 0x6b / 250.0 , 1.0 }};
2298+ std::vector<Scalar> stops = {
2299+ 0.0 ,
2300+ (1.0 / 6.0 ) * 1 ,
2301+ (1.0 / 6.0 ) * 2 ,
2302+ (1.0 / 6.0 ) * 3 ,
2303+ (1.0 / 6.0 ) * 4 ,
2304+ (1.0 / 6.0 ) * 5 ,
2305+ 1.0 ,
2306+ };
2307+ auto texture = CreateTextureForFixture (" airplane.jpg" ,
2308+ /* enable_mipmapping=*/ true );
2309+
2310+ paint.color = Color::White ().WithAlpha (0.1 );
2311+
2312+ paint.color_source = ColorSource::MakeRadialGradient (
2313+ {500 , 550 }, 75 , std::move (gradient_colors), std::move (stops),
2314+ Entity::TileMode::kMirror , {});
2315+ for (int i = 1 ; i <= 10 ; i++) {
2316+ int j = 11 - i;
2317+ canvas.DrawRRect (Rect::MakeLTRB (500 - i * 20 , 550 - j * 20 , //
2318+ 500 + i * 20 , 550 + j * 20 ),
2319+ Size (i * 10 , j * 10 ), paint);
2320+ }
2321+
2322+ paint.color_source = ColorSource::MakeImage (
2323+ texture, Entity::TileMode::kRepeat , Entity::TileMode::kRepeat , {},
2324+ Matrix::MakeTranslation ({500 , 20 }));
2325+ for (int i = 1 ; i <= 10 ; i++) {
2326+ int j = 11 - i;
2327+ canvas.DrawRRect (Rect::MakeLTRB (700 - i * 20 , 220 - j * 20 , //
2328+ 700 + i * 20 , 220 + j * 20 ),
2329+ Size (i * 10 , j * 10 ), paint);
2330+ }
2331+
2332+ ASSERT_TRUE (OpenPlaygroundHere (canvas.EndRecordingAsPicture ()));
2333+ }
2334+
22672335TEST_P (AiksTest, GradientStrokesRenderCorrectly) {
22682336 // Compare with https://fiddle.skia.org/c/027392122bec8ac2b5d5de00a4b9bbe2
22692337 auto callback = [&](AiksContext& renderer) -> std::optional<Picture> {
@@ -4335,9 +4403,9 @@ TEST_P(AiksTest, GaussianBlurAtPeripheryVertical) {
43354403
43364404 canvas.Scale (GetContentScale ());
43374405 canvas.DrawRRect (Rect::MakeLTRB (0 , 0 , GetWindowSize ().width , 100 ),
4338- Point (10 , 10 ), Paint{.color = Color::LimeGreen ()});
4406+ Size (10 , 10 ), Paint{.color = Color::LimeGreen ()});
43394407 canvas.DrawRRect (Rect::MakeLTRB (0 , 110 , GetWindowSize ().width , 210 ),
4340- Point (10 , 10 ), Paint{.color = Color::Magenta ()});
4408+ Size (10 , 10 ), Paint{.color = Color::Magenta ()});
43414409 canvas.ClipRect (Rect::MakeLTRB (100 , 0 , 200 , GetWindowSize ().height ));
43424410 canvas.SaveLayer ({.blend_mode = BlendMode::kSource }, std::nullopt ,
43434411 ImageFilter::MakeBlur (Sigma (20.0 ), Sigma (20.0 ),
@@ -4358,7 +4426,7 @@ TEST_P(AiksTest, GaussianBlurAtPeripheryHorizontal) {
43584426 Rect::MakeXYWH (0 , 0 , boston->GetSize ().width , boston->GetSize ().height ),
43594427 Rect::MakeLTRB (0 , 0 , GetWindowSize ().width , 100 ), Paint{});
43604428 canvas.DrawRRect (Rect::MakeLTRB (0 , 110 , GetWindowSize ().width , 210 ),
4361- Point (10 , 10 ), Paint{.color = Color::Magenta ()});
4429+ Size (10 , 10 ), Paint{.color = Color::Magenta ()});
43624430 canvas.ClipRect (Rect::MakeLTRB (0 , 50 , GetWindowSize ().width , 150 ));
43634431 canvas.SaveLayer ({.blend_mode = BlendMode::kSource }, std::nullopt ,
43644432 ImageFilter::MakeBlur (Sigma (20.0 ), Sigma (20.0 ),
0 commit comments