Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions impeller/aiks/aiks_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion impeller/entity/contents/solid_rrect_blur_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 3 additions & 0 deletions testing/impeller_golden_tests_output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down