Add stroke sampler dispatch helper coverage
This commit is contained in:
@@ -509,6 +509,11 @@ Done Checks:
|
|||||||
|
|
||||||
Progress Notes:
|
Progress Notes:
|
||||||
|
|
||||||
|
- 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
|
||||||
|
helper-builder regression without reopening landed texture or dual-pass
|
||||||
|
helpers.
|
||||||
- 2026-06-13: `Canvas::stroke_draw()` live-pass sampler dispatch now reuses a
|
- 2026-06-13: `Canvas::stroke_draw()` live-pass sampler dispatch now reuses a
|
||||||
retained helper builder for brush-tip, destination, pattern, and mixer
|
retained helper builder for brush-tip, destination, pattern, and mixer
|
||||||
sampler callbacks; the live adapter still owns the concrete sampler objects.
|
sampler callbacks; the live adapter still owns the concrete sampler objects.
|
||||||
|
|||||||
@@ -232,6 +232,34 @@ void retained_stroke_sampler_dispatch_routes_bind_and_unbind_per_input(pp::tests
|
|||||||
PP_EXPECT(h, events == expected_events);
|
PP_EXPECT(h, events == expected_events);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void retained_stroke_sampler_dispatch_helper_builds_expected_callback_wiring(pp::tests::Harness& h)
|
||||||
|
{
|
||||||
|
std::vector<std::string> events;
|
||||||
|
const auto dispatch = pp::panopainter::make_legacy_canvas_stroke_sampler_dispatch(
|
||||||
|
[&](int slot) { events.emplace_back("bind:brush_tip:" + std::to_string(slot)); },
|
||||||
|
[&] { events.emplace_back("unbind:brush_tip"); },
|
||||||
|
[&](int slot) { events.emplace_back("bind:destination:" + std::to_string(slot)); },
|
||||||
|
[&] { events.emplace_back("unbind:destination"); },
|
||||||
|
[&](int slot) { events.emplace_back("bind:pattern:" + std::to_string(slot)); },
|
||||||
|
[&] { events.emplace_back("unbind:pattern"); },
|
||||||
|
[&](int slot) { events.emplace_back("bind:mixer:" + std::to_string(slot)); },
|
||||||
|
[&] { events.emplace_back("unbind:mixer"); });
|
||||||
|
|
||||||
|
pp::panopainter::bind_legacy_canvas_stroke_sampler_input(
|
||||||
|
LegacyCanvasStrokeTextureInput::pattern,
|
||||||
|
6,
|
||||||
|
dispatch);
|
||||||
|
pp::panopainter::unbind_legacy_canvas_stroke_sampler_input(
|
||||||
|
LegacyCanvasStrokeTextureInput::pattern,
|
||||||
|
dispatch);
|
||||||
|
|
||||||
|
const std::vector<std::string> expected_events {
|
||||||
|
"bind:pattern:6",
|
||||||
|
"unbind:pattern",
|
||||||
|
};
|
||||||
|
PP_EXPECT(h, events == expected_events);
|
||||||
|
}
|
||||||
|
|
||||||
void retained_stroke_sample_executor_copies_destination_and_expands_quads(pp::tests::Harness& h)
|
void retained_stroke_sample_executor_copies_destination_and_expands_quads(pp::tests::Harness& h)
|
||||||
{
|
{
|
||||||
const auto vertices = make_quad_vertices();
|
const auto vertices = make_quad_vertices();
|
||||||
@@ -1309,6 +1337,9 @@ int main()
|
|||||||
harness.run(
|
harness.run(
|
||||||
"retained_stroke_sampler_dispatch_routes_bind_and_unbind_per_input",
|
"retained_stroke_sampler_dispatch_routes_bind_and_unbind_per_input",
|
||||||
retained_stroke_sampler_dispatch_routes_bind_and_unbind_per_input);
|
retained_stroke_sampler_dispatch_routes_bind_and_unbind_per_input);
|
||||||
|
harness.run(
|
||||||
|
"retained_stroke_sampler_dispatch_helper_builds_expected_callback_wiring",
|
||||||
|
retained_stroke_sampler_dispatch_helper_builds_expected_callback_wiring);
|
||||||
harness.run(
|
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",
|
||||||
retained_stroke_sample_executor_unbinds_and_skips_draw_when_bounds_are_empty);
|
retained_stroke_sample_executor_unbinds_and_skips_draw_when_bounds_are_empty);
|
||||||
|
|||||||
Reference in New Issue
Block a user