Reuse main stroke texture dispatch helper
This commit is contained in:
@@ -509,6 +509,12 @@ Done Checks:
|
||||
|
||||
Progress Notes:
|
||||
|
||||
- 2026-06-13: `Canvas::stroke_draw()` main-pass texture dispatch now reuses
|
||||
retained helper builders for texture-unit, brush-tip, pattern, and mixer
|
||||
callback wiring; the live adapter still owns the concrete textures and
|
||||
sampler state. Next slice should target the remaining inline `stroke_draw()`
|
||||
dispatch construction or another narrow seam without reopening landed pad or
|
||||
dual-pass helpers.
|
||||
- 2026-06-13: `Canvas::stroke_draw()` dual-brush replay now reuses the new
|
||||
retained brush-tip texture dispatch helper for binding and unbinding; the
|
||||
live adapter still owns the concrete brush texture object and live-pass
|
||||
|
||||
@@ -758,27 +758,27 @@ void Canvas::stroke_draw()
|
||||
},
|
||||
};
|
||||
const pp::panopainter::LegacyCanvasStrokeTextureInputDispatch main_pass_texture_dispatch {
|
||||
.activate_texture_unit = [&](int texture_slot) {
|
||||
set_active_texture_unit(texture_slot);
|
||||
},
|
||||
.bind_brush_tip = [&] {
|
||||
brush->m_tip_texture->bind();
|
||||
},
|
||||
.unbind_brush_tip = [&] {
|
||||
brush->m_tip_texture->unbind();
|
||||
},
|
||||
.bind_pattern = [&] {
|
||||
brush->m_pattern_texture ?
|
||||
brush->m_pattern_texture->bind() :
|
||||
unbind_texture_2d();
|
||||
},
|
||||
.bind_mixer = [&] {
|
||||
m_mixer.bindTexture();
|
||||
},
|
||||
.unbind_mixer = [&] {
|
||||
m_mixer.unbindTexture();
|
||||
},
|
||||
};
|
||||
pp::panopainter::make_legacy_canvas_stroke_main_pass_texture_dispatch(
|
||||
[&](int texture_slot) {
|
||||
set_active_texture_unit(texture_slot);
|
||||
},
|
||||
[&] {
|
||||
brush->m_tip_texture->bind();
|
||||
},
|
||||
[&] {
|
||||
brush->m_tip_texture->unbind();
|
||||
},
|
||||
[&] {
|
||||
brush->m_pattern_texture ?
|
||||
brush->m_pattern_texture->bind() :
|
||||
unbind_texture_2d();
|
||||
},
|
||||
[&] {
|
||||
m_mixer.bindTexture();
|
||||
},
|
||||
[&] {
|
||||
m_mixer.unbindTexture();
|
||||
});
|
||||
pp::panopainter::bind_legacy_canvas_stroke_sampler_inputs(
|
||||
live_pass_sampler_bindings,
|
||||
live_pass_sampler_dispatch);
|
||||
|
||||
@@ -86,6 +86,24 @@ struct LegacyCanvasStrokeTextureInputDispatch {
|
||||
std::function<void()> unbind_mixer;
|
||||
};
|
||||
|
||||
[[nodiscard]] inline LegacyCanvasStrokeTextureInputDispatch make_legacy_canvas_stroke_main_pass_texture_dispatch(
|
||||
std::function<void(int)> activate_texture_unit,
|
||||
std::function<void()> bind_brush_tip,
|
||||
std::function<void()> unbind_brush_tip,
|
||||
std::function<void()> bind_pattern,
|
||||
std::function<void()> bind_mixer,
|
||||
std::function<void()> unbind_mixer)
|
||||
{
|
||||
return LegacyCanvasStrokeTextureInputDispatch {
|
||||
.activate_texture_unit = std::move(activate_texture_unit),
|
||||
.bind_brush_tip = std::move(bind_brush_tip),
|
||||
.unbind_brush_tip = std::move(unbind_brush_tip),
|
||||
.bind_pattern = std::move(bind_pattern),
|
||||
.bind_mixer = std::move(bind_mixer),
|
||||
.unbind_mixer = std::move(unbind_mixer),
|
||||
};
|
||||
}
|
||||
|
||||
[[nodiscard]] inline LegacyCanvasStrokeTextureInputDispatch make_legacy_canvas_stroke_brush_tip_texture_dispatch(
|
||||
std::function<void(int)> activate_texture_unit,
|
||||
std::function<void()> bind_brush_tip,
|
||||
|
||||
Reference in New Issue
Block a user