Extract preview main pass texture dispatch
This commit is contained in:
@@ -2611,6 +2611,54 @@ void legacy_node_stroke_preview_main_live_pass_preserves_order(pp::tests::Harnes
|
||||
PP_EXPECT(h, !invalid);
|
||||
}
|
||||
|
||||
void legacy_node_stroke_preview_main_pass_texture_dispatch_preserves_order(pp::tests::Harness& h)
|
||||
{
|
||||
std::vector<std::string> steps;
|
||||
const auto run = [&](bool copy_stroke_destination, bool uses_mixer) {
|
||||
steps.clear();
|
||||
pp::panopainter::bind_legacy_node_stroke_preview_main_pass_textures(
|
||||
pp::panopainter::make_legacy_node_stroke_preview_main_pass_texture_dispatch(
|
||||
[&](int texture_slot) {
|
||||
steps.emplace_back("unit:" + std::to_string(texture_slot));
|
||||
},
|
||||
[&] {
|
||||
steps.emplace_back("bind_tip");
|
||||
},
|
||||
[&] {
|
||||
steps.emplace_back("bind_destination");
|
||||
},
|
||||
[&] {
|
||||
steps.emplace_back("bind_pattern");
|
||||
},
|
||||
[&] {
|
||||
steps.emplace_back("bind_mixer");
|
||||
}),
|
||||
copy_stroke_destination,
|
||||
uses_mixer);
|
||||
};
|
||||
|
||||
run(false, false);
|
||||
PP_EXPECT(h, steps == std::vector<std::string> {
|
||||
"unit:0",
|
||||
"bind_tip",
|
||||
"unit:2",
|
||||
"bind_pattern",
|
||||
"unit:3",
|
||||
});
|
||||
|
||||
run(true, true);
|
||||
PP_EXPECT(h, steps == std::vector<std::string> {
|
||||
"unit:0",
|
||||
"bind_tip",
|
||||
"unit:1",
|
||||
"bind_destination",
|
||||
"unit:2",
|
||||
"bind_pattern",
|
||||
"unit:3",
|
||||
"bind_mixer",
|
||||
});
|
||||
}
|
||||
|
||||
void legacy_node_stroke_preview_stroke_setup_plan_preserves_curve_and_dual_inputs(pp::tests::Harness& h)
|
||||
{
|
||||
const auto plan = pp::panopainter::plan_legacy_node_stroke_preview_stroke_setup(
|
||||
@@ -3204,6 +3252,9 @@ int main()
|
||||
harness.run(
|
||||
"legacy_node_stroke_preview_main_live_pass_preserves_order",
|
||||
legacy_node_stroke_preview_main_live_pass_preserves_order);
|
||||
harness.run(
|
||||
"legacy_node_stroke_preview_main_pass_texture_dispatch_preserves_order",
|
||||
legacy_node_stroke_preview_main_pass_texture_dispatch_preserves_order);
|
||||
harness.run(
|
||||
"legacy_node_stroke_preview_stroke_setup_plan_preserves_curve_and_dual_inputs",
|
||||
legacy_node_stroke_preview_stroke_setup_plan_preserves_curve_and_dual_inputs);
|
||||
|
||||
Reference in New Issue
Block a user