Route stroke commit composite through service

This commit is contained in:
2026-06-12 22:47:54 +02:00
parent 2ee6534918
commit 458f9bef0c
3 changed files with 34 additions and 29 deletions

View File

@@ -18,6 +18,11 @@ agent or engineer to remove them without reconstructing context from chat.
## Recent Reductions ## Recent Reductions
- 2026-06-12: DEBT-0036 was narrowed again. `Canvas::stroke_commit` now reuses
`legacy_canvas_stroke_composite_services.h` for commit-time final stroke
`kShader::CompDraw` binding and composite/pattern/dual uniform writes.
Texture/framebuffer binding, copy ordering, layer dirty mutation, and
non-stroke composite callers remain retained legacy execution.
- 2026-06-12: DEBT-0036 was narrowed again. Canvas stroke padding and commit - 2026-06-12: DEBT-0036 was narrowed again. Canvas stroke padding and commit
dilate shader setup now route retained `kShader::StrokePad` and dilate shader setup now route retained `kShader::StrokePad` and
`kShader::StrokeDilate` binding/uniform writes through `kShader::StrokeDilate` binding/uniform writes through

View File

@@ -1350,11 +1350,12 @@ OpenGL stroke execution service seam. Live stroke `kShader::Stroke` binding,
setup, blend, pattern, and per-sample uniform writes now pass through setup, blend, pattern, and per-sample uniform writes now pass through
`legacy_canvas_stroke_shader_services.h`. Live draw-merge and preview final `legacy_canvas_stroke_shader_services.h`. Live draw-merge and preview final
stroke composite `kShader::CompDraw` setup now pass through stroke composite `kShader::CompDraw` setup now pass through
`legacy_canvas_stroke_composite_services.h`. Stroke padding and commit dilate `legacy_canvas_stroke_composite_services.h`, and `Canvas::stroke_commit` now
`kShader::StrokePad`/`kShader::StrokeDilate` setup now pass through reuses that same composite service for commit-time final stroke compositing.
`legacy_canvas_stroke_edge_services.h`, leaving RTT/texture ownership, Stroke padding and commit dilate `kShader::StrokePad`/`kShader::StrokeDilate`
dirty-box policy, checkerboard/commit composite shaders, quad expansion, and setup now pass through `legacy_canvas_stroke_edge_services.h`, leaving
retained callback execution under `DEBT-0036`. RTT/texture ownership, dirty-box policy, checkerboard/non-stroke composite
shaders, quad expansion, and retained callback execution under `DEBT-0036`.
It also owns renderer API texture-format to It also owns renderer API texture-format to
OpenGL internal/pixel/component token mapping, including depth-stencil formats, OpenGL internal/pixel/component token mapping, including depth-stencil formats,
for future backend texture objects. `Texture2D` 2D texture binding, upload, for future backend texture objects. `Texture2D` 2D texture binding, upload,

View File

@@ -1059,30 +1059,29 @@ void Canvas::stroke_commit()
if (b->m_pattern_flipx) patt_scale.x *= -1.f; if (b->m_pattern_flipx) patt_scale.x *= -1.f;
if (b->m_pattern_flipy) patt_scale.y *= -1.f; if (b->m_pattern_flipy) patt_scale.y *= -1.f;
ShaderManager::use(kShader::CompDraw); pp::panopainter::setup_legacy_stroke_composite_shader(
ShaderManager::u_int(kShaderUniform::Tex, 0); pp::panopainter::LegacyStrokeCompositeUniforms {
ShaderManager::u_int(kShaderUniform::TexStroke, 1); .resolution = m_size,
ShaderManager::u_int(kShaderUniform::TexMask, 2); .pattern = {
ShaderManager::u_int(kShaderUniform::TexDual, 3); .scale = patt_scale,
ShaderManager::u_int(kShaderUniform::TexPattern, 4); .invert = static_cast<float>(b->m_pattern_invert),
ShaderManager::u_vec2(kShaderUniform::Resolution, m_size); .brightness = b->m_pattern_brightness,
ShaderManager::u_float(kShaderUniform::Alpha, 1); .contrast = b->m_pattern_contrast,
ShaderManager::u_int(kShaderUniform::Mask, m_smask_active); .depth = b->m_pattern_depth,
ShaderManager::u_int(kShaderUniform::Lock, m_layers[m_current_layer_idx]->m_alpha_locked); .blend_mode = b->m_pattern_blend_mode,
ShaderManager::u_int(kShaderUniform::UseFragcoord, false); .offset = m_pattern_offset,
ShaderManager::u_int(kShaderUniform::BlendMode, b->m_blend_mode); },
ShaderManager::u_mat4(kShaderUniform::MVP, glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f)); .mvp = glm::ortho(-.5f, .5f, -.5f, .5f, -1.f, 1.f),
ShaderManager::u_int(kShaderUniform::UseDual, stroke_material.composite_pass.use_dual); .layer_alpha = 1.0f,
ShaderManager::u_int(kShaderUniform::DualBlendMode, stroke_material.composite_pass.dual_blend_mode); .alpha_lock = m_layers[m_current_layer_idx]->m_alpha_locked,
ShaderManager::u_float(kShaderUniform::DualAlpha, stroke_material.composite_pass.dual_alpha); .mask_enabled = m_smask_active,
ShaderManager::u_int(kShaderUniform::UsePattern, stroke_material.composite_pass.use_pattern); .use_fragcoord = false,
ShaderManager::u_vec2(kShaderUniform::PatternScale, patt_scale); .blend_mode = b->m_blend_mode,
ShaderManager::u_float(kShaderUniform::PatternInvert, b->m_pattern_invert); .use_dual = stroke_material.composite_pass.use_dual,
ShaderManager::u_float(kShaderUniform::PatternBright, b->m_pattern_brightness); .dual_blend_mode = stroke_material.composite_pass.dual_blend_mode,
ShaderManager::u_float(kShaderUniform::PatternContrast, b->m_pattern_contrast); .dual_alpha = stroke_material.composite_pass.dual_alpha,
ShaderManager::u_float(kShaderUniform::PatternDepth, b->m_pattern_depth); .use_pattern = stroke_material.composite_pass.use_pattern,
ShaderManager::u_int(kShaderUniform::PatternBlendMode, b->m_pattern_blend_mode); });
ShaderManager::u_vec2(kShaderUniform::PatternOffset, m_pattern_offset);
set_active_texture_unit(0); set_active_texture_unit(0);
m_tex2[i].bind(); m_tex2[i].bind();