Reuse stroke brush tip dispatch helper
This commit is contained in:
@@ -509,12 +509,11 @@ Done Checks:
|
|||||||
|
|
||||||
Progress Notes:
|
Progress Notes:
|
||||||
|
|
||||||
- 2026-06-13: `Canvas::stroke_draw()` dual-brush replay now routes shader
|
- 2026-06-13: `Canvas::stroke_draw()` dual-brush replay now reuses the new
|
||||||
setup, brush-tip texture binding, live-pass execution, and brush-tip
|
retained brush-tip texture dispatch helper for binding and unbinding; the
|
||||||
unbinding through `execute_legacy_canvas_stroke_dual_pass(...)`; the live
|
live adapter still owns the concrete brush texture object and live-pass
|
||||||
adapter still owns the concrete texture callbacks and face-frame replay.
|
execution. Next slice should target another narrow `stroke_draw()` seam
|
||||||
Next slice should target another narrow `stroke_draw()` seam without
|
without reopening landed pad or sample helpers.
|
||||||
reopening landed pad or sample helpers.
|
|
||||||
- 2026-06-13: `Canvas::stroke_draw()` dual-brush replay now routes shader
|
- 2026-06-13: `Canvas::stroke_draw()` dual-brush replay now routes shader
|
||||||
setup, brush-tip texture binding, live-pass execution, and brush-tip
|
setup, brush-tip texture binding, live-pass execution, and brush-tip
|
||||||
unbinding through `execute_legacy_canvas_stroke_dual_pass(...)`; the live
|
unbinding through `execute_legacy_canvas_stroke_dual_pass(...)`; the live
|
||||||
|
|||||||
@@ -926,16 +926,20 @@ void Canvas::stroke_draw()
|
|||||||
.bind_brush_tip = [&] {
|
.bind_brush_tip = [&] {
|
||||||
pp::panopainter::bind_legacy_canvas_stroke_texture_inputs(
|
pp::panopainter::bind_legacy_canvas_stroke_texture_inputs(
|
||||||
dual_pass_texture_bindings,
|
dual_pass_texture_bindings,
|
||||||
pp::panopainter::LegacyCanvasStrokeTextureInputDispatch {
|
pp::panopainter::make_legacy_canvas_stroke_brush_tip_texture_dispatch(
|
||||||
.activate_texture_unit = [&](int texture_slot) {
|
[&](int texture_slot) {
|
||||||
set_active_texture_unit(texture_slot);
|
set_active_texture_unit(texture_slot);
|
||||||
},
|
},
|
||||||
.bind_brush_tip = [&] {
|
[&] {
|
||||||
dual_brush->m_tip_texture ?
|
dual_brush->m_tip_texture ?
|
||||||
dual_brush->m_tip_texture->bind() :
|
dual_brush->m_tip_texture->bind() :
|
||||||
unbind_texture_2d();
|
unbind_texture_2d();
|
||||||
},
|
},
|
||||||
});
|
[&] {
|
||||||
|
dual_brush->m_tip_texture ?
|
||||||
|
dual_brush->m_tip_texture->unbind() :
|
||||||
|
unbind_texture_2d();
|
||||||
|
}));
|
||||||
},
|
},
|
||||||
.execute_frame_pass = [&] {
|
.execute_frame_pass = [&] {
|
||||||
pp::panopainter::execute_legacy_canvas_stroke_live_pass_with_face_framebuffers(
|
pp::panopainter::execute_legacy_canvas_stroke_live_pass_with_face_framebuffers(
|
||||||
@@ -962,16 +966,20 @@ void Canvas::stroke_draw()
|
|||||||
.unbind_brush_tip = [&] {
|
.unbind_brush_tip = [&] {
|
||||||
pp::panopainter::unbind_legacy_canvas_stroke_texture_inputs(
|
pp::panopainter::unbind_legacy_canvas_stroke_texture_inputs(
|
||||||
dual_pass_texture_bindings,
|
dual_pass_texture_bindings,
|
||||||
pp::panopainter::LegacyCanvasStrokeTextureInputDispatch {
|
pp::panopainter::make_legacy_canvas_stroke_brush_tip_texture_dispatch(
|
||||||
.activate_texture_unit = [&](int texture_slot) {
|
[&](int texture_slot) {
|
||||||
set_active_texture_unit(texture_slot);
|
set_active_texture_unit(texture_slot);
|
||||||
},
|
},
|
||||||
.unbind_brush_tip = [&] {
|
[&] {
|
||||||
|
dual_brush->m_tip_texture ?
|
||||||
|
dual_brush->m_tip_texture->bind() :
|
||||||
|
unbind_texture_2d();
|
||||||
|
},
|
||||||
|
[&] {
|
||||||
dual_brush->m_tip_texture ?
|
dual_brush->m_tip_texture ?
|
||||||
dual_brush->m_tip_texture->unbind() :
|
dual_brush->m_tip_texture->unbind() :
|
||||||
unbind_texture_2d();
|
unbind_texture_2d();
|
||||||
},
|
}));
|
||||||
});
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,18 @@ struct LegacyCanvasStrokeTextureInputDispatch {
|
|||||||
std::function<void()> unbind_mixer;
|
std::function<void()> 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,
|
||||||
|
std::function<void()> unbind_brush_tip)
|
||||||
|
{
|
||||||
|
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),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
struct LegacyCanvasStrokeSamplerDispatch {
|
struct LegacyCanvasStrokeSamplerDispatch {
|
||||||
std::function<void(int)> bind_brush_tip_sampler;
|
std::function<void(int)> bind_brush_tip_sampler;
|
||||||
std::function<void()> unbind_brush_tip_sampler;
|
std::function<void()> unbind_brush_tip_sampler;
|
||||||
|
|||||||
Reference in New Issue
Block a user