diff --git a/docs/modernization/tasks.md b/docs/modernization/tasks.md index 3d00ad9..79d4686 100644 --- a/docs/modernization/tasks.md +++ b/docs/modernization/tasks.md @@ -509,6 +509,10 @@ Done Checks: Progress Notes: +- 2026-06-13: `pp_paint_renderer_stroke_execution_tests` now also covers the + new retained main-pass texture dispatch helper builder and its pattern/mixer + wiring. Next slice should target another narrow `stroke_draw()` seam or stop + once the remaining inline code is just trivial binding glue. - 2026-06-13: `pp_paint_renderer_stroke_execution_tests` now covers the new retained sampler dispatch helper builder and its pattern bind/unbind wiring. Next slice should target another narrow `stroke_draw()` seam or another diff --git a/tests/paint_renderer/stroke_execution_tests.cpp b/tests/paint_renderer/stroke_execution_tests.cpp index e4a252b..4627d36 100644 --- a/tests/paint_renderer/stroke_execution_tests.cpp +++ b/tests/paint_renderer/stroke_execution_tests.cpp @@ -260,6 +260,33 @@ void retained_stroke_sampler_dispatch_helper_builds_expected_callback_wiring(pp: PP_EXPECT(h, events == expected_events); } +void retained_stroke_main_pass_texture_dispatch_helper_builds_expected_callback_wiring(pp::tests::Harness& h) +{ + std::vector events; + const auto dispatch = pp::panopainter::make_legacy_canvas_stroke_main_pass_texture_dispatch( + [&](int slot) { events.emplace_back("activate:" + std::to_string(slot)); }, + [&] { events.emplace_back("bind:brush_tip"); }, + [&] { events.emplace_back("unbind:brush_tip"); }, + [&] { events.emplace_back("bind:pattern"); }, + [&] { events.emplace_back("bind:mixer"); }, + [&] { events.emplace_back("unbind:mixer"); }); + + pp::panopainter::bind_legacy_canvas_stroke_texture_input( + LegacyCanvasStrokeTextureInput::pattern, + dispatch); + pp::panopainter::unbind_legacy_canvas_stroke_texture_input( + LegacyCanvasStrokeTextureInput::mixer, + dispatch); + + const std::vector expected_events { + "activate:2", + "bind:pattern", + "activate:3", + "unbind:mixer", + }; + PP_EXPECT(h, events == expected_events); +} + void retained_stroke_sample_executor_copies_destination_and_expands_quads(pp::tests::Harness& h) { const auto vertices = make_quad_vertices(); @@ -1340,6 +1367,9 @@ int main() harness.run( "retained_stroke_sampler_dispatch_helper_builds_expected_callback_wiring", retained_stroke_sampler_dispatch_helper_builds_expected_callback_wiring); + harness.run( + "retained_stroke_main_pass_texture_dispatch_helper_builds_expected_callback_wiring", + retained_stroke_main_pass_texture_dispatch_helper_builds_expected_callback_wiring); harness.run( "retained_stroke_sample_executor_unbinds_and_skips_draw_when_bounds_are_empty", retained_stroke_sample_executor_unbinds_and_skips_draw_when_bounds_are_empty);