Extract stroke mix setup shell
This commit is contained in:
@@ -18,6 +18,10 @@ agent or engineer to remove them without reconstructing context from chat.
|
|||||||
|
|
||||||
## Recent Reductions
|
## Recent Reductions
|
||||||
|
|
||||||
|
- 2026-06-13: `LATER-003` was narrowed again. `Canvas::stroke_draw_mix()` now
|
||||||
|
routes the setup/end shell through
|
||||||
|
`make_legacy_canvas_stroke_mix_pass_setup(...)`; the live path still owns
|
||||||
|
the concrete framebuffer bind and GL capability toggles.
|
||||||
- 2026-06-13: `LATER-003` was narrowed again. `Canvas::stroke_draw_mix()` now
|
- 2026-06-13: `LATER-003` was narrowed again. `Canvas::stroke_draw_mix()` now
|
||||||
routes its retained mix-pass execution shell through
|
routes its retained mix-pass execution shell through
|
||||||
`execute_legacy_canvas_stroke_mix_pass_with_setup(...)` with a concrete
|
`execute_legacy_canvas_stroke_mix_pass_with_setup(...)` with a concrete
|
||||||
|
|||||||
@@ -595,6 +595,9 @@ Progress Notes:
|
|||||||
execution shell through `execute_legacy_canvas_stroke_mix_pass_with_setup(...)`
|
execution shell through `execute_legacy_canvas_stroke_mix_pass_with_setup(...)`
|
||||||
with a concrete request builder; the live path still owns the OpenGL setup
|
with a concrete request builder; the live path still owns the OpenGL setup
|
||||||
and per-plane texture wiring.
|
and per-plane texture wiring.
|
||||||
|
- 2026-06-13: `Canvas::stroke_draw_mix()` now routes the setup/end shell through
|
||||||
|
`make_legacy_canvas_stroke_mix_pass_setup(...)`; the live path still owns the
|
||||||
|
concrete framebuffer bind and GL capability toggles.
|
||||||
- 2026-06-13: `Canvas::stroke_draw()` live-pass sampler wiring now reuses a
|
- 2026-06-13: `Canvas::stroke_draw()` live-pass sampler wiring now reuses a
|
||||||
retained helper builder, and the stroke execution tests cover it. `STR-004`
|
retained helper builder, and the stroke execution tests cover it. `STR-004`
|
||||||
is now done after the final pad-destination helper extraction and tracker
|
is now done after the final pad-destination helper extraction and tracker
|
||||||
|
|||||||
@@ -403,8 +403,7 @@ void Canvas::stroke_draw_mix(const glm::vec2& bb_min, const glm::vec2& bb_sz)
|
|||||||
return current_layer.face(plane_index);
|
return current_layer.face(plane_index);
|
||||||
});
|
});
|
||||||
const auto& b = m_current_stroke->m_brush;
|
const auto& b = m_current_stroke->m_brush;
|
||||||
[[maybe_unused]] const auto mix_result =
|
const auto mix_setup = pp::panopainter::make_legacy_canvas_stroke_mix_pass_setup(
|
||||||
pp::panopainter::execute_legacy_canvas_stroke_mix_pass_with_setup(
|
|
||||||
[&] {
|
[&] {
|
||||||
m_mixer.bindFramebuffer();
|
m_mixer.bindFramebuffer();
|
||||||
apply_canvas_viewport(0, 0, m_mixer.getWidth(), m_mixer.getHeight());
|
apply_canvas_viewport(0, 0, m_mixer.getWidth(), m_mixer.getHeight());
|
||||||
@@ -419,7 +418,11 @@ void Canvas::stroke_draw_mix(const glm::vec2& bb_min, const glm::vec2& bb_sz)
|
|||||||
},
|
},
|
||||||
[&] {
|
[&] {
|
||||||
m_mixer.unbindFramebuffer();
|
m_mixer.unbindFramebuffer();
|
||||||
},
|
});
|
||||||
|
[[maybe_unused]] const auto mix_result =
|
||||||
|
pp::panopainter::execute_legacy_canvas_stroke_mix_pass_with_setup(
|
||||||
|
mix_setup.begin,
|
||||||
|
mix_setup.end,
|
||||||
pp::panopainter::make_legacy_canvas_stroke_mix_pass_request(
|
pp::panopainter::make_legacy_canvas_stroke_mix_pass_request(
|
||||||
"Canvas::stroke_draw_mix",
|
"Canvas::stroke_draw_mix",
|
||||||
m_size,
|
m_size,
|
||||||
|
|||||||
@@ -340,6 +340,21 @@ struct LegacyCanvasStrokeMixPassResult {
|
|||||||
std::size_t composed_planes = 0;
|
std::size_t composed_planes = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct LegacyCanvasStrokeMixPassSetup {
|
||||||
|
std::function<void()> begin;
|
||||||
|
std::function<void()> end;
|
||||||
|
};
|
||||||
|
|
||||||
|
[[nodiscard]] inline LegacyCanvasStrokeMixPassSetup make_legacy_canvas_stroke_mix_pass_setup(
|
||||||
|
std::function<void()> begin,
|
||||||
|
std::function<void()> end)
|
||||||
|
{
|
||||||
|
return LegacyCanvasStrokeMixPassSetup {
|
||||||
|
.begin = std::move(begin),
|
||||||
|
.end = std::move(end),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] inline LegacyCanvasStrokeMixPassRequest make_legacy_canvas_stroke_mix_pass_request(
|
[[nodiscard]] inline LegacyCanvasStrokeMixPassRequest make_legacy_canvas_stroke_mix_pass_request(
|
||||||
std::string_view context,
|
std::string_view context,
|
||||||
glm::vec2 resolution,
|
glm::vec2 resolution,
|
||||||
|
|||||||
@@ -1885,6 +1885,24 @@ void retained_stroke_mix_pass_request_builder_preserves_callback_wiring(pp::test
|
|||||||
PP_EXPECT(h, events == expected_events);
|
PP_EXPECT(h, events == expected_events);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void retained_stroke_mix_pass_setup_builder_preserves_boundaries(pp::tests::Harness& h)
|
||||||
|
{
|
||||||
|
std::vector<std::string> events;
|
||||||
|
const auto setup = pp::panopainter::make_legacy_canvas_stroke_mix_pass_setup(
|
||||||
|
[&] { events.emplace_back("begin"); },
|
||||||
|
[&] { events.emplace_back("end"); });
|
||||||
|
|
||||||
|
PP_EXPECT(h, setup.begin);
|
||||||
|
PP_EXPECT(h, setup.end);
|
||||||
|
|
||||||
|
setup.begin();
|
||||||
|
setup.end();
|
||||||
|
|
||||||
|
PP_EXPECT(h, events.size() == 2U);
|
||||||
|
PP_EXPECT(h, events[0] == "begin");
|
||||||
|
PP_EXPECT(h, events[1] == "end");
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
@@ -1992,5 +2010,8 @@ int main()
|
|||||||
harness.run(
|
harness.run(
|
||||||
"retained_stroke_mix_pass_request_builder_preserves_callback_wiring",
|
"retained_stroke_mix_pass_request_builder_preserves_callback_wiring",
|
||||||
retained_stroke_mix_pass_request_builder_preserves_callback_wiring);
|
retained_stroke_mix_pass_request_builder_preserves_callback_wiring);
|
||||||
|
harness.run(
|
||||||
|
"retained_stroke_mix_pass_setup_builder_preserves_boundaries",
|
||||||
|
retained_stroke_mix_pass_setup_builder_preserves_boundaries);
|
||||||
return harness.finish();
|
return harness.finish();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user