Extract stroke draw dual pass request helper
This commit is contained in:
@@ -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(...)`;
|
||||
the retained path still owns the concrete dual-pass request shell and frame
|
||||
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
|
||||
live face orchestration now routes through
|
||||
`execute_legacy_canvas_stroke_live_pass_with_face_framebuffers(...)`; the
|
||||
|
||||
@@ -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-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-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
|
||||
|
||||
@@ -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
|
||||
|
||||
Status: Ready
|
||||
Status: Done
|
||||
Score: +1 renderer boundary and OpenGL parity
|
||||
Debt: `DEBT-0036`
|
||||
Scope: `src/canvas.cpp`, `src/legacy_canvas_stroke_execution_services.h`, `tests/paint_renderer/compositor_tests.cpp`
|
||||
@@ -755,6 +756,8 @@ Done Checks:
|
||||
wiring.
|
||||
- `docs/modernization/debt.md` records the reduced dual-pass request surface.
|
||||
|
||||
Closeout: `77ac50b9`
|
||||
|
||||
Validation:
|
||||
|
||||
```powershell
|
||||
|
||||
110
src/canvas.cpp
110
src/canvas.cpp
@@ -887,45 +887,77 @@ void Canvas::stroke_draw_dual_pass(
|
||||
{
|
||||
[[maybe_unused]] const auto dual_result =
|
||||
pp::panopainter::execute_legacy_canvas_stroke_dual_pass(
|
||||
pp::panopainter::LegacyCanvasStrokeDualPassRequest {
|
||||
.context = "Canvas::stroke_draw",
|
||||
.bind_brush_tip = [&] {
|
||||
pp::panopainter::bind_legacy_canvas_stroke_texture_inputs(
|
||||
dual_pass_texture_bindings,
|
||||
dual_pass_brush_tip_dispatch);
|
||||
},
|
||||
.unbind_brush_tip = [&] {
|
||||
pp::panopainter::unbind_legacy_canvas_stroke_texture_inputs(
|
||||
dual_pass_texture_bindings,
|
||||
dual_pass_brush_tip_dispatch);
|
||||
},
|
||||
.setup_dual_shader = [&] {
|
||||
pp::panopainter::setup_legacy_canvas_stroke_dual_shader(
|
||||
uses_pattern);
|
||||
},
|
||||
.execute_frame_pass = [&] {
|
||||
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);
|
||||
},
|
||||
});
|
||||
make_stroke_draw_dual_pass_request(
|
||||
frames_dual,
|
||||
dual_pass_texture_bindings,
|
||||
dual_pass_brush_tip_dispatch,
|
||||
stroke_extent,
|
||||
include_dual_dirty,
|
||||
uses_pattern,
|
||||
copy_stroke_destination));
|
||||
}
|
||||
|
||||
pp::panopainter::LegacyCanvasStrokeDualPassRequest Canvas::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)
|
||||
{
|
||||
return pp::panopainter::LegacyCanvasStrokeDualPassRequest {
|
||||
.context = "Canvas::stroke_draw",
|
||||
.bind_brush_tip = [&] {
|
||||
pp::panopainter::bind_legacy_canvas_stroke_texture_inputs(
|
||||
dual_pass_texture_bindings,
|
||||
dual_pass_brush_tip_dispatch);
|
||||
},
|
||||
.unbind_brush_tip = [&] {
|
||||
pp::panopainter::unbind_legacy_canvas_stroke_texture_inputs(
|
||||
dual_pass_texture_bindings,
|
||||
dual_pass_brush_tip_dispatch);
|
||||
},
|
||||
.setup_dual_shader = [&] {
|
||||
pp::panopainter::setup_legacy_canvas_stroke_dual_shader(
|
||||
uses_pattern);
|
||||
},
|
||||
.execute_frame_pass = [&] {
|
||||
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()
|
||||
|
||||
13
src/canvas.h
13
src/canvas.h
@@ -255,6 +255,19 @@ private:
|
||||
const std::array<bool, 6>& include_dual_dirty,
|
||||
bool uses_pattern,
|
||||
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);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user