Skip to content

Commit

Permalink
[Impeller] Ignore the mask filter when saving layer (flutter#39583)
Browse files Browse the repository at this point in the history
* [Impeller] Ignore the mask filter when saving layer

* Add test
  • Loading branch information
ColdPaleLight authored Feb 15, 2023
1 parent bf7d515 commit 414538f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 0 additions & 1 deletion impeller/aiks/paint.cc
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 414538f

Please sign in to comment.