Extract dual stroke tip dispatch overload

This commit is contained in:
2026-06-13 18:48:25 +02:00
parent 819b0f31db
commit 6b12c520f0
5 changed files with 55 additions and 6 deletions

View File

@@ -309,6 +309,27 @@ void retained_stroke_brush_tip_texture_dispatch_helper_builds_expected_callback_
PP_EXPECT(h, events == expected_events);
}
void retained_stroke_brush_tip_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_brush_tip_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)); },
2);
dispatch.activate_texture_unit(0);
dispatch.bind_brush_tip();
dispatch.unbind_brush_tip();
const std::vector<std::string> expected_events {
"activate:0",
"bind:2",
"unbind:2",
};
PP_EXPECT(h, events == expected_events);
}
void retained_stroke_live_pass_sampler_dispatch_helper_builds_expected_callback_wiring(pp::tests::Harness& h)
{
std::vector<std::string> events;
@@ -1818,6 +1839,9 @@ int main()
harness.run(
"retained_stroke_brush_tip_texture_dispatch_helper_builds_expected_callback_wiring",
retained_stroke_brush_tip_texture_dispatch_helper_builds_expected_callback_wiring);
harness.run(
"retained_stroke_brush_tip_texture_dispatch_helper_builds_expected_face_wiring",
retained_stroke_brush_tip_texture_dispatch_helper_builds_expected_face_wiring);
harness.run(
"retained_stroke_destination_texture_dispatch_helper_builds_expected_callback_wiring",
retained_stroke_destination_texture_dispatch_helper_builds_expected_callback_wiring);