Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Impeller] Ignore the mask filter when saving layer #39583

Merged
merged 2 commits into from Feb 15, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion impeller/aiks/paint.cc
Expand Up @@ -69,7 +69,6 @@ std::shared_ptr<Contents> Paint::WithFilters(
std::shared_ptr<Contents> Paint::WithFiltersForSubpassTarget(
std::shared_ptr<Contents> input,
const Matrix& effect_transform) const {
input = WithMaskBlur(input, false, effect_transform);
input = WithImageFilter(input, effect_transform);
input = WithColorFilter(input, /**absorb_opacity=*/true);
return input;
Expand Down
13 changes: 13 additions & 0 deletions impeller/display_list/display_list_unittests.cc
Expand Up @@ -265,6 +265,19 @@ TEST_P(DisplayListTest, CanDrawWithMaskBlur) {
ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
}

TEST_P(DisplayListTest, IgnoreMaskFilterWhenSavingLayer) {
auto texture = CreateTextureForFixture("embarcadero.jpg");
flutter::DisplayListBuilder builder;
auto filter = flutter::DlBlurMaskFilter(kNormal_SkBlurStyle, 10.0f);
flutter::DlPaint paint;
paint.setMaskFilter(&filter);
builder.saveLayer(nullptr, &paint);
builder.drawImage(DlImageImpeller::Make(texture), SkPoint::Make(100, 100),
flutter::DlImageSampling::kNearestNeighbor);
builder.restore();
ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
}

TEST_P(DisplayListTest, CanDrawWithBlendColorFilter) {
auto texture = CreateTextureForFixture("embarcadero.jpg");
flutter::DisplayListBuilder builder;
Expand Down