Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 1 commit
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
Prev Previous commit
updated tests
  • Loading branch information
gaaclarke committed May 17, 2024
commit 4960576774880a0ca27f991acad2e3c91b54698e
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ TEST_P(MatrixFilterContentsTest, RenderCoverageMatchesGetCoverageTranslate) {
}

TEST_P(MatrixFilterContentsTest,
RenderCoverageMatchesGetCoverageSubpassTranslate) {
RenderCoverageMatchesGetCoverageBackdropSubpassTranslate) {
std::shared_ptr<Texture> texture = MakeTexture(ISize(100, 100));
MatrixFilterContents contents;
contents.SetInputs({FilterInput::Make(texture)});
Expand Down Expand Up @@ -176,7 +176,8 @@ TEST_P(MatrixFilterContentsTest, RenderCoverageMatchesGetCoverageScale) {
Rect::MakeXYWH(100, 200, 300, 300));
}

TEST_P(MatrixFilterContentsTest, RenderCoverageMatchesGetCoverageSubpassScale) {
TEST_P(MatrixFilterContentsTest,
RenderCoverageMatchesGetCoverageBackdropSubpassScale) {
std::shared_ptr<Texture> texture = MakeTexture(ISize(100, 100));
MatrixFilterContents contents;
contents.SetInputs({FilterInput::Make(texture)});
Expand All @@ -194,5 +195,24 @@ TEST_P(MatrixFilterContentsTest, RenderCoverageMatchesGetCoverageSubpassScale) {
Rect::MakeXYWH(100, 200, 300, 300));
}

TEST_P(MatrixFilterContentsTest,
RenderCoverageMatchesGetCoverageImageFilterSubpassScale) {
std::shared_ptr<Texture> texture = MakeTexture(ISize(100, 100));
MatrixFilterContents contents;
contents.SetInputs({FilterInput::Make(texture)});
contents.SetMatrix(Matrix::MakeScale({3, 3, 1}));
contents.SetEffectTransform(Matrix::MakeScale({2, 2, 1}));
contents.SetRenderingMode(Entity::RenderingMode::kImageFilterSubpass);

Entity entity;
entity.SetTransform(Matrix::MakeTranslation({100, 200, 0}));

std::shared_ptr<ContentContext> renderer = GetContentContext();
std::optional<Entity> result =
contents.GetEntity(*renderer, entity, /*coverage_hint=*/{});
expectRenderCoverageEqual(result, contents.GetCoverage(entity),
Rect::MakeXYWH(300, 600, 300, 300));
}

} // namespace testing
} // namespace impeller