Extract pad destination dispatch overload

This commit is contained in:
2026-06-13 18:47:21 +02:00
parent 58885187ba
commit 819b0f31db
5 changed files with 69 additions and 14 deletions

View File

@@ -361,6 +361,27 @@ void retained_stroke_pad_destination_texture_dispatch_helper_builds_expected_cal
PP_EXPECT(h, events == expected_events);
}
void retained_stroke_pad_destination_texture_dispatch_helper_builds_expected_face_wiring(pp::tests::Harness& h)
{
std::vector<std::string> events;
const auto dispatch = pp::panopainter::make_legacy_canvas_stroke_pad_destination_texture_dispatch(
[&](int slot) { events.emplace_back("activate:" + std::to_string(slot)); },
[&](int face_index) { events.emplace_back("bind:" + std::to_string(face_index)); },
[&](int face_index) { events.emplace_back("unbind:" + std::to_string(face_index)); },
4);
dispatch.activate_texture_unit(1);
dispatch.bind_stroke_destination();
dispatch.unbind_stroke_destination();
const std::vector<std::string> expected_events {
"activate:1",
"bind:4",
"unbind:4",
};
PP_EXPECT(h, events == expected_events);
}
void retained_stroke_destination_texture_dispatch_helper_builds_expected_callback_wiring(pp::tests::Harness& h)
{
std::vector<std::string> events;
@@ -1791,6 +1812,9 @@ int main()
harness.run(
"retained_stroke_pad_destination_texture_dispatch_helper_builds_expected_callback_wiring",
retained_stroke_pad_destination_texture_dispatch_helper_builds_expected_callback_wiring);
harness.run(
"retained_stroke_pad_destination_texture_dispatch_helper_builds_expected_face_wiring",
retained_stroke_pad_destination_texture_dispatch_helper_builds_expected_face_wiring);
harness.run(
"retained_stroke_brush_tip_texture_dispatch_helper_builds_expected_callback_wiring",
retained_stroke_brush_tip_texture_dispatch_helper_builds_expected_callback_wiring);