Add main stroke texture dispatch helper coverage

This commit is contained in:
2026-06-13 16:55:18 +02:00
parent 818f2b10ad
commit 0aa0ac4497
2 changed files with 34 additions and 0 deletions

View File

@@ -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

View File

@@ -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<std::string> 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<std::string> 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);