From ac783580224c1040a3e57f961736e9ac5cce1bb9 Mon Sep 17 00:00:00 2001 From: omigamedev Date: Sat, 13 Jun 2026 05:13:18 +0200 Subject: [PATCH] Route stroke preview checkerboard setup through helper --- docs/modernization/debt.md | 5 +++++ docs/modernization/roadmap.md | 4 ++++ src/node_stroke_preview.cpp | 11 +++++++---- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/modernization/debt.md b/docs/modernization/debt.md index db3e0ee..5d93f0f 100644 --- a/docs/modernization/debt.md +++ b/docs/modernization/debt.md @@ -18,6 +18,11 @@ agent or engineer to remove them without reconstructing context from chat. ## Recent Reductions +- 2026-06-13: DEBT-0036 was narrowed again. `NodeStrokePreview` preview + background checkerboard shader setup now routes through + `legacy_canvas_draw_merge_services.h`, preserving the existing colorize + condition and preview MVP. The retained preview path still owns background + capture ordering, texture copies, stroke setup, and draw execution. - 2026-06-13: DEBT-0036 was narrowed again. `Canvas::draw_merge` non-stroke `TextureBlend` shader setup now routes through `legacy_canvas_draw_merge_services.h`, preserving the optional `TexBG` diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index 2fb95ff..e9a5fe5 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -2997,6 +2997,10 @@ Results: optional `TexBG` uniform when copy-based blend destination feedback is active. Layer traversal, framebuffer copies, sampler/texture binding, and draw ordering remain in the legacy Canvas path. +- `NodeStrokePreview` preview background drawing now shares the retained + draw-merge shader setup helper for checkerboard uniforms, preserving its + colorize condition and preview MVP while leaving capture ordering, texture + copies, stroke setup, and draw execution in the retained preview path. - `Canvas::stroke_draw_mix` now shares the retained stroke composite shader helper for mixer-pass `CompDraw` setup, while preserving its caller-specific texture slot uniforms. Mixer framebuffer/scissor state, sampler and texture diff --git a/src/node_stroke_preview.cpp b/src/node_stroke_preview.cpp index fb85a50..4fe0cf6 100644 --- a/src/node_stroke_preview.cpp +++ b/src/node_stroke_preview.cpp @@ -6,6 +6,7 @@ #include "bezier.h" #include "canvas.h" #include "app.h" +#include "legacy_canvas_draw_merge_services.h" #include "legacy_canvas_stroke_composite_services.h" #include "legacy_canvas_stroke_execution_services.h" #include "legacy_canvas_stroke_preview_services.h" @@ -517,10 +518,12 @@ void NodeStrokePreview::draw_stroke_immediate() pp::panopainter::execute_legacy_stroke_preview_background_capture( [&] { // copy background color to tex2 - ShaderManager::use(kShader::Checkerboard); - ShaderManager::u_int(kShaderUniform::Colorize, b->m_tip_mix > 0.f || b->m_blend_mode != 0); - float aspect = size.x / size.y; - ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-.5f, .5f, -.5f / aspect, .5f / aspect, -1.f, 1.f)); + const float aspect = size.x / size.y; + pp::panopainter::setup_legacy_canvas_draw_merge_checkerboard_shader( + pp::panopainter::LegacyCanvasDrawMergeCheckerboardUniforms { + .mvp = glm::ortho(-.5f, .5f, -.5f / aspect, .5f / aspect, -1.f, 1.f), + .colorize = b->m_tip_mix > 0.f || b->m_blend_mode != 0, + }); }, [&] { m_plane.draw_fill();