Extract stroke draw dual pass request helper

This commit is contained in:
2026-06-13 23:26:13 +02:00
parent 4661305733
commit e5e334bf74
4 changed files with 92 additions and 40 deletions

View File

@@ -267,6 +267,10 @@ agent or engineer to remove them without reconstructing context from chat.
frame callback body now routes through `stroke_draw_dual_pass_frame_pass(...)`; frame callback body now routes through `stroke_draw_dual_pass_frame_pass(...)`;
the retained path still owns the concrete dual-pass request shell and frame the retained path still owns the concrete dual-pass request shell and frame
execution wiring. execution wiring.
- 2026-06-13: DEBT-0036 was narrowed again. `Canvas::stroke_draw()` dual-pass
request assembly now routes through `make_stroke_draw_dual_pass_request(...)`;
the retained path still owns the concrete request execution shell and frame
callbacks.
- 2026-06-13: DEBT-0036 was narrowed again. `Canvas::stroke_draw()` main-pass - 2026-06-13: DEBT-0036 was narrowed again. `Canvas::stroke_draw()` main-pass
live face orchestration now routes through live face orchestration now routes through
`execute_legacy_canvas_stroke_live_pass_with_face_framebuffers(...)`; the `execute_legacy_canvas_stroke_live_pass_with_face_framebuffers(...)`; the

View File

@@ -675,6 +675,7 @@ ctest --preset desktop-fast --build-config Debug -R "pp_paint_renderer_composito
| 2026-06-13 | STR-022 | +1 renderer boundary and OpenGL parity | `ctest --preset desktop-fast --build-config Debug -R "pp_paint_renderer_compositor|pp_paint_renderer_stroke_execution" --output-on-failure` | `065ddf8e` | | 2026-06-13 | STR-022 | +1 renderer boundary and OpenGL parity | `ctest --preset desktop-fast --build-config Debug -R "pp_paint_renderer_compositor|pp_paint_renderer_stroke_execution" --output-on-failure` | `065ddf8e` |
| 2026-06-13 | STR-023 | +1 renderer boundary and OpenGL parity | `ctest --preset desktop-fast --build-config Debug -R "pp_paint_renderer_compositor|pp_paint_renderer_stroke_execution" --output-on-failure` | `07b188de` | | 2026-06-13 | STR-023 | +1 renderer boundary and OpenGL parity | `ctest --preset desktop-fast --build-config Debug -R "pp_paint_renderer_compositor|pp_paint_renderer_stroke_execution" --output-on-failure` | `07b188de` |
| 2026-06-13 | STR-024 | +1 renderer boundary and OpenGL parity | `ctest --preset desktop-fast --build-config Debug -R "pp_paint_renderer_compositor|pp_paint_renderer_stroke_execution" --output-on-failure` | `b1d6e5e2` | | 2026-06-13 | STR-024 | +1 renderer boundary and OpenGL parity | `ctest --preset desktop-fast --build-config Debug -R "pp_paint_renderer_compositor|pp_paint_renderer_stroke_execution" --output-on-failure` | `b1d6e5e2` |
| 2026-06-13 | STR-025 | +1 renderer boundary and OpenGL parity | `ctest --preset desktop-fast --build-config Debug -R "pp_paint_renderer_compositor|pp_paint_renderer_stroke_execution" --output-on-failure` | `77ac50b9` |
### STR-023 - Extract Stroke Draw Dual Pass Frame Orchestration ### STR-023 - Extract Stroke Draw Dual Pass Frame Orchestration
@@ -707,7 +708,7 @@ ctest --preset desktop-fast --build-config Debug -R "pp_paint_renderer_composito
### STR-024 - Extract Stroke Draw Dual Pass Frame Callback Body ### STR-024 - Extract Stroke Draw Dual Pass Frame Callback Body
Status: Ready Status: Done
Score: +1 renderer boundary and OpenGL parity Score: +1 renderer boundary and OpenGL parity
Debt: `DEBT-0036` Debt: `DEBT-0036`
Scope: `src/canvas.cpp`, `src/legacy_canvas_stroke_execution_services.h`, `tests/paint_renderer/compositor_tests.cpp` Scope: `src/canvas.cpp`, `src/legacy_canvas_stroke_execution_services.h`, `tests/paint_renderer/compositor_tests.cpp`
@@ -755,6 +756,8 @@ Done Checks:
wiring. wiring.
- `docs/modernization/debt.md` records the reduced dual-pass request surface. - `docs/modernization/debt.md` records the reduced dual-pass request surface.
Closeout: `77ac50b9`
Validation: Validation:
```powershell ```powershell

View File

@@ -887,45 +887,77 @@ void Canvas::stroke_draw_dual_pass(
{ {
[[maybe_unused]] const auto dual_result = [[maybe_unused]] const auto dual_result =
pp::panopainter::execute_legacy_canvas_stroke_dual_pass( pp::panopainter::execute_legacy_canvas_stroke_dual_pass(
pp::panopainter::LegacyCanvasStrokeDualPassRequest { make_stroke_draw_dual_pass_request(
.context = "Canvas::stroke_draw", frames_dual,
.bind_brush_tip = [&] { dual_pass_texture_bindings,
pp::panopainter::bind_legacy_canvas_stroke_texture_inputs( dual_pass_brush_tip_dispatch,
dual_pass_texture_bindings, stroke_extent,
dual_pass_brush_tip_dispatch); include_dual_dirty,
}, uses_pattern,
.unbind_brush_tip = [&] { copy_stroke_destination));
pp::panopainter::unbind_legacy_canvas_stroke_texture_inputs( }
dual_pass_texture_bindings,
dual_pass_brush_tip_dispatch); pp::panopainter::LegacyCanvasStrokeDualPassRequest Canvas::make_stroke_draw_dual_pass_request(
}, const std::vector<StrokeFrame>& frames_dual,
.setup_dual_shader = [&] { const std::array<pp::panopainter::LegacyCanvasStrokeTextureBinding, 1>& dual_pass_texture_bindings,
pp::panopainter::setup_legacy_canvas_stroke_dual_shader( const pp::panopainter::LegacyCanvasStrokeTextureInputDispatch& dual_pass_brush_tip_dispatch,
uses_pattern); const pp::renderer::Extent2D& stroke_extent,
}, const std::array<bool, 6>& include_dual_dirty,
.execute_frame_pass = [&] { bool uses_pattern,
pp::panopainter::execute_legacy_canvas_stroke_dual_pass_frame_callbacks( bool copy_stroke_destination)
frames_dual, {
stroke_extent, return pp::panopainter::LegacyCanvasStrokeDualPassRequest {
std::span<glm::vec4>(m_dirty_box), .context = "Canvas::stroke_draw",
std::span<glm::vec4>(), .bind_brush_tip = [&] {
std::span<const bool>(include_dual_dirty), pp::panopainter::bind_legacy_canvas_stroke_texture_inputs(
[&](auto& f) { dual_pass_texture_bindings,
pp::panopainter::apply_legacy_stroke_sample_uniforms( dual_pass_brush_tip_dispatch);
pp::panopainter::LegacyStrokeSampleUniforms { },
.color = f.col, .unbind_brush_tip = [&] {
.alpha = f.flow, pp::panopainter::unbind_legacy_canvas_stroke_texture_inputs(
.opacity = f.opacity, dual_pass_texture_bindings,
}); dual_pass_brush_tip_dispatch);
}, },
[](auto&, int, auto&) {}, .setup_dual_shader = [&] {
[&](auto&, int i, auto& P) { pp::panopainter::setup_legacy_canvas_stroke_dual_shader(
return stroke_draw_samples(i, P, copy_stroke_destination); uses_pattern);
}, },
m_tmp_dual, .execute_frame_pass = [&] {
true); stroke_draw_dual_pass_frame_pass(
}, frames_dual,
}); stroke_extent,
include_dual_dirty,
copy_stroke_destination);
},
};
}
void Canvas::stroke_draw_dual_pass_frame_pass(
const std::vector<StrokeFrame>& frames_dual,
const pp::renderer::Extent2D& stroke_extent,
const std::array<bool, 6>& include_dual_dirty,
bool copy_stroke_destination)
{
pp::panopainter::execute_legacy_canvas_stroke_dual_pass_frame_callbacks(
frames_dual,
stroke_extent,
std::span<glm::vec4>(m_dirty_box),
std::span<glm::vec4>(),
std::span<const bool>(include_dual_dirty),
[&](auto& f) {
pp::panopainter::apply_legacy_stroke_sample_uniforms(
pp::panopainter::LegacyStrokeSampleUniforms {
.color = f.col,
.alpha = f.flow,
.opacity = f.opacity,
});
},
[](auto&, int, auto&) {},
[&](auto&, int i, auto& P) {
return stroke_draw_samples(i, P, copy_stroke_destination);
},
m_tmp_dual,
true);
} }
void Canvas::stroke_draw() void Canvas::stroke_draw()

View File

@@ -255,6 +255,19 @@ private:
const std::array<bool, 6>& include_dual_dirty, const std::array<bool, 6>& include_dual_dirty,
bool uses_pattern, bool uses_pattern,
bool copy_stroke_destination); bool copy_stroke_destination);
pp::panopainter::LegacyCanvasStrokeDualPassRequest make_stroke_draw_dual_pass_request(
const std::vector<StrokeFrame>& frames_dual,
const std::array<pp::panopainter::LegacyCanvasStrokeTextureBinding, 1>& dual_pass_texture_bindings,
const pp::panopainter::LegacyCanvasStrokeTextureInputDispatch& dual_pass_brush_tip_dispatch,
const pp::renderer::Extent2D& stroke_extent,
const std::array<bool, 6>& include_dual_dirty,
bool uses_pattern,
bool copy_stroke_destination);
void stroke_draw_dual_pass_frame_pass(
const std::vector<StrokeFrame>& frames_dual,
const pp::renderer::Extent2D& stroke_extent,
const std::array<bool, 6>& include_dual_dirty,
bool copy_stroke_destination);
Image thumbnail_read(std::string file_path); Image thumbnail_read(std::string file_path);
void draw_objects(std::function<void(const glm::mat4& camera, const glm::mat4& proj, int i)>, int frame, bool save_history); void draw_objects(std::function<void(const glm::mat4& camera, const glm::mat4& proj, int i)>, int frame, bool save_history);
void draw_objects(std::function<void(const glm::mat4& camera, const glm::mat4& proj, int i)>, Layer& layer, int frame, bool save_history); void draw_objects(std::function<void(const glm::mat4& camera, const glm::mat4& proj, int i)>, Layer& layer, int frame, bool save_history);