diff --git a/impeller/aiks/aiks_unittests.cc b/impeller/aiks/aiks_unittests.cc index 1525d9f9087d7..cdf59f42a58ad 100644 --- a/impeller/aiks/aiks_unittests.cc +++ b/impeller/aiks/aiks_unittests.cc @@ -1246,6 +1246,32 @@ TEST_P(AiksTest, SolidColorCirclesOvalsRRectsMaskBlurCorrectly) { ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture())); } +TEST_P(AiksTest, FastEllipticalRRectMaskBlursRenderCorrectly) { + Canvas canvas; + canvas.Scale(GetContentScale()); + Paint paint; + paint.mask_blur_descriptor = Paint::MaskBlurDescriptor{ + .style = FilterContents::BlurStyle::kNormal, + .sigma = Sigma{1}, + }; + + canvas.DrawPaint({.color = Color::White()}); + + paint.color = Color::Blue(); + for (int i = 0; i < 5; i++) { + Scalar y = i * 125; + Scalar y_radius = i * 15; + for (int j = 0; j < 5; j++) { + Scalar x = j * 125; + Scalar x_radius = j * 15; + canvas.DrawRRect(Rect::MakeXYWH(x + 50, y + 50, 100.0f, 100.0f), + {x_radius, y_radius}, paint); + } + } + + ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture())); +} + TEST_P(AiksTest, FilledRoundRectPathsRenderCorrectly) { Canvas canvas; canvas.Scale(GetContentScale()); diff --git a/impeller/entity/contents/solid_rrect_blur_contents.cc b/impeller/entity/contents/solid_rrect_blur_contents.cc index b6bdffd2b7d81..4f62435a02dad 100644 --- a/impeller/entity/contents/solid_rrect_blur_contents.cc +++ b/impeller/entity/contents/solid_rrect_blur_contents.cc @@ -113,7 +113,7 @@ bool SolidRRectBlurContents::Render(const ContentContext& renderer, frag_info.rect_size = Point(positive_rect.GetSize()); frag_info.corner_radii = {std::clamp(corner_radii_.width, kEhCloseEnough, positive_rect.GetWidth() * 0.5f), - std::clamp(corner_radii_.width, kEhCloseEnough, + std::clamp(corner_radii_.height, kEhCloseEnough, positive_rect.GetHeight() * 0.5f)}; pass.SetCommandLabel("RRect Shadow"); diff --git a/testing/impeller_golden_tests_output.txt b/testing/impeller_golden_tests_output.txt index affa64d1f9e4a..6a25f99892e82 100644 --- a/testing/impeller_golden_tests_output.txt +++ b/testing/impeller_golden_tests_output.txt @@ -596,6 +596,9 @@ impeller_Play_AiksTest_EmptySaveLayerIgnoresPaint_Vulkan.png impeller_Play_AiksTest_EmptySaveLayerRendersWithClear_Metal.png impeller_Play_AiksTest_EmptySaveLayerRendersWithClear_OpenGLES.png impeller_Play_AiksTest_EmptySaveLayerRendersWithClear_Vulkan.png +impeller_Play_AiksTest_FastEllipticalRRectMaskBlursRenderCorrectly_Metal.png +impeller_Play_AiksTest_FastEllipticalRRectMaskBlursRenderCorrectly_OpenGLES.png +impeller_Play_AiksTest_FastEllipticalRRectMaskBlursRenderCorrectly_Vulkan.png impeller_Play_AiksTest_FastGradientTestHorizontalReversed_Metal.png impeller_Play_AiksTest_FastGradientTestHorizontalReversed_OpenGLES.png impeller_Play_AiksTest_FastGradientTestHorizontalReversed_Vulkan.png