Lock stroke mix shell coverage

This commit is contained in:
2026-06-13 19:43:23 +02:00
parent ecc3b3edad
commit 2887d02484
4 changed files with 86 additions and 44 deletions

View File

@@ -1959,15 +1959,6 @@ void retained_stroke_mix_pass_shell_builder_preserves_combined_wiring(pp::tests:
shell.request.unbind_mix_samplers();
shell.setup.end();
events.clear();
shell.setup.begin();
const auto shell_result = pp::panopainter::execute_legacy_canvas_stroke_mix_pass_shell(
shell.setup.begin,
shell.setup.end,
shell.request);
PP_EXPECT(h, shell_result.ok);
PP_EXPECT(h, shell_result.composed_planes == 1U);
const std::vector<std::string> expected_events {
"begin",
"bind-samplers",
@@ -1985,6 +1976,68 @@ void retained_stroke_mix_pass_shell_builder_preserves_combined_wiring(pp::tests:
PP_EXPECT(h, events == expected_events);
}
void retained_stroke_mix_pass_shell_executor_preserves_combined_wiring(pp::tests::Harness& h)
{
const std::array<LegacyCanvasStrokeMixPassPlane, 1> planes {
LegacyCanvasStrokeMixPassPlane { .index = 5, .visible = true, .has_target = true, .opacity = 0.5F },
};
std::vector<std::string> events;
const auto shell = pp::panopainter::make_legacy_canvas_stroke_mix_pass_shell(
[&] { events.emplace_back("begin"); },
[&] { events.emplace_back("end"); },
"mix-shell-executor",
glm::vec2(32.0F, 16.0F),
planes,
[&] { events.emplace_back("bind-samplers"); },
[&] { events.emplace_back("unbind-samplers"); },
[&](int plane_index, const glm::mat4&) {
events.emplace_back("setup:" + std::to_string(plane_index));
},
[&](int plane_index) {
events.emplace_back("bind-layer:" + std::to_string(plane_index));
},
[&](int plane_index) {
events.emplace_back("bind-stroke:" + std::to_string(plane_index));
},
[&](int plane_index) {
events.emplace_back("bind-mask:" + std::to_string(plane_index));
},
[&] { events.emplace_back("draw"); },
[&](int plane_index) {
events.emplace_back("unbind-mask:" + std::to_string(plane_index));
},
[&](int plane_index) {
events.emplace_back("unbind-stroke:" + std::to_string(plane_index));
},
[&](int plane_index) {
events.emplace_back("unbind-layer:" + std::to_string(plane_index));
});
const auto shell_result = pp::panopainter::execute_legacy_canvas_stroke_mix_pass_shell(
shell.setup.begin,
shell.setup.end,
shell.request);
PP_EXPECT(h, shell_result.ok);
PP_EXPECT(h, shell_result.composed_planes == 1U);
const std::vector<std::string> expected_events {
"begin",
"bind-samplers",
"setup:5",
"bind-layer:5",
"bind-stroke:5",
"bind-mask:5",
"draw",
"unbind-mask:5",
"unbind-stroke:5",
"unbind-layer:5",
"unbind-samplers",
"end",
};
PP_EXPECT(h, events == expected_events);
}
} // namespace
int main()
@@ -2098,5 +2151,8 @@ int main()
harness.run(
"retained_stroke_mix_pass_shell_builder_preserves_combined_wiring",
retained_stroke_mix_pass_shell_builder_preserves_combined_wiring);
harness.run(
"retained_stroke_mix_pass_shell_executor_preserves_combined_wiring",
retained_stroke_mix_pass_shell_executor_preserves_combined_wiring);
return harness.finish();
}