From 718c9224b9f91309eea05f2cd762f1b7fd939566 Mon Sep 17 00:00:00 2001 From: omigamedev Date: Sat, 13 Jun 2026 18:53:31 +0200 Subject: [PATCH] Extract preview final composite wrapper --- docs/modernization/debt.md | 3 +++ docs/modernization/tasks.md | 3 +++ src/node_stroke_preview.cpp | 23 +++++++++++++++++------ 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index 8fa584f..e86fa2d 100644 --- a/docs/modernization/debt.md +++ b/docs/modernization/debt.md @@ -18,6 +18,9 @@ agent or engineer to remove them without reconstructing context from chat. ## Recent Reductions +- 2026-06-13: `DEBT-0036` was narrowed again. `NodeStrokePreview::draw_stroke_immediate()` + now routes final composite execution and preview copy-back through a retained + local wrapper, leaving the call site with only sequence wiring. - 2026-06-13: `LATER-003` was narrowed again. `Canvas::stroke_draw()` now routes dual-brush tip dispatch through retained helper overloads, so the face-index callback wiring is no longer built inline in the dual-pass diff --git a/docs/modernization/tasks.md b/docs/modernization/tasks.md index 2179c4f..c7b9f08 100644 --- a/docs/modernization/tasks.md +++ b/docs/modernization/tasks.md @@ -575,6 +575,9 @@ Done Checks: Progress Notes: +- 2026-06-13: `NodeStrokePreview::draw_stroke_immediate()` now routes final + composite execution and preview copy-back through a retained local wrapper, + leaving the call site with only sequence wiring. - 2026-06-13: `Canvas::stroke_draw()` now routes dual-brush tip dispatch through retained helper overloads, so the face-index callback wiring is no longer built inline in the dual-pass branch. diff --git a/src/node_stroke_preview.cpp b/src/node_stroke_preview.cpp index 8c26333..857e329 100644 --- a/src/node_stroke_preview.cpp +++ b/src/node_stroke_preview.cpp @@ -205,10 +205,21 @@ void execute_stroke_preview_final_composite_pass(const StrokePreviewCompositePas .draw_composite = [&] { inputs.draw_composite(); }, - }); + }); assert(composite_ok); } +void copy_stroke_preview_result_to_texture(Texture2D& texture, glm::vec2 size); + +void execute_stroke_preview_final_composite_and_copy( + const StrokePreviewCompositePassInputs& inputs, + Texture2D& preview_texture, + glm::vec2 size) +{ + execute_stroke_preview_final_composite_pass(inputs); + copy_stroke_preview_result_to_texture(preview_texture, size); +} + void copy_stroke_preview_framebuffer_to_texture( Texture2D& texture, glm::vec2 size, @@ -838,7 +849,7 @@ void NodeStrokePreview::draw_stroke_immediate() }, .finish_main_pass = [&] {}, .execute_final_composite = [&] { - execute_stroke_preview_final_composite_pass( + execute_stroke_preview_final_composite_and_copy( StrokePreviewCompositePassInputs { .resolution = size, .pattern_scale = patt_scale, @@ -852,11 +863,11 @@ void NodeStrokePreview::draw_stroke_immediate() .draw_composite = [&] { m_plane.draw_fill(); }, - }); - }, - .copy_preview_result = [&] { - copy_stroke_preview_result_to_texture(m_tex_preview, size); + }, + m_tex_preview, + size); }, + .copy_preview_result = [&] {}, }); assert(sequence_ok);