Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 97699aa

Browse files
committed
added scale test for non subpass
1 parent bd44a7a commit 97699aa

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

impeller/entity/contents/filters/matrix_filter_contents_unittests.cc

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,23 @@ TEST_P(MatrixFilterContentsTest,
159159
Rect::MakeXYWH(200, 400, 100, 100));
160160
}
161161

162+
TEST_P(MatrixFilterContentsTest, RenderCoverageMatchesGetCoverageScale) {
163+
std::shared_ptr<Texture> texture = MakeTexture(ISize(100, 100));
164+
MatrixFilterContents contents;
165+
contents.SetInputs({FilterInput::Make(texture)});
166+
contents.SetMatrix(Matrix::MakeScale({3, 3, 1}));
167+
contents.SetEffectTransform(Matrix::MakeScale({2, 2, 1}));
168+
169+
Entity entity;
170+
entity.SetTransform(Matrix::MakeTranslation({100, 200, 0}));
171+
172+
std::shared_ptr<ContentContext> renderer = GetContentContext();
173+
std::optional<Entity> result =
174+
contents.GetEntity(*renderer, entity, /*coverage_hint=*/{});
175+
expectRenderCoverageEqual(result, contents.GetCoverage(entity),
176+
Rect::MakeXYWH(100, 200, 300, 300));
177+
}
178+
162179
TEST_P(MatrixFilterContentsTest, RenderCoverageMatchesGetCoverageSubpassScale) {
163180
std::shared_ptr<Texture> texture = MakeTexture(ISize(100, 100));
164181
MatrixFilterContents contents;
@@ -174,7 +191,7 @@ TEST_P(MatrixFilterContentsTest, RenderCoverageMatchesGetCoverageSubpassScale) {
174191
std::optional<Entity> result =
175192
contents.GetEntity(*renderer, entity, /*coverage_hint=*/{});
176193
expectRenderCoverageEqual(result, contents.GetCoverage(entity),
177-
Rect::MakeXYWH(300, 600, 300, 300));
194+
Rect::MakeXYWH(100, 200, 300, 300));
178195
}
179196

180197
} // namespace testing

0 commit comments

Comments
 (0)