This test fails to render antyhing and produces no helpful error output in the wild, but validation errors in a unit test:
TEST_P(EntityTest, ColorFilterContentsWithLargeGeometry) {
Entity entity;
entity.SetTransformation(Matrix::MakeScale(GetContentScale()));
auto src_contents = std::make_shared<SolidColorContents>();
src_contents->SetGeometry(
Geometry::MakeRect(Rect::MakeLTRB(-300, -500, 30000, 50000)));
src_contents->SetColor(Color::Red());
auto dst_contents = std::make_shared<SolidColorContents>();
dst_contents->SetGeometry(
Geometry::MakeRect(Rect::MakeLTRB(300, 500, 20000, 30000)));
dst_contents->SetColor(Color::Blue());
auto contents = ColorFilterContents::MakeBlend(
BlendMode::kSourceOver, {FilterInput::Make(dst_contents, false),
FilterInput::Make(src_contents, false)});
entity.SetContents(std::move(contents));
ASSERT_TRUE(OpenPlaygroundHere(entity));
}
We can hit this code path in a few ways:
- Certain usages of
drawVertices
- Setting
invertColors to true on Paint.
- I think we can hit it via some kind of mask blur but I'm not sure.