Extract dual stroke tip dispatch overload
This commit is contained in:
@@ -946,16 +946,17 @@ void Canvas::stroke_draw()
|
||||
[&](int texture_slot) {
|
||||
set_active_texture_unit(texture_slot);
|
||||
},
|
||||
[&] {
|
||||
[&](int) {
|
||||
dual_brush->m_tip_texture ?
|
||||
dual_brush->m_tip_texture->bind() :
|
||||
unbind_texture_2d();
|
||||
},
|
||||
[&] {
|
||||
[&](int) {
|
||||
dual_brush->m_tip_texture ?
|
||||
dual_brush->m_tip_texture->unbind() :
|
||||
unbind_texture_2d();
|
||||
}));
|
||||
},
|
||||
0));
|
||||
},
|
||||
.unbind_brush_tip = [&] {
|
||||
pp::panopainter::unbind_legacy_canvas_stroke_texture_inputs(
|
||||
@@ -964,16 +965,17 @@ void Canvas::stroke_draw()
|
||||
[&](int texture_slot) {
|
||||
set_active_texture_unit(texture_slot);
|
||||
},
|
||||
[&] {
|
||||
[&](int) {
|
||||
dual_brush->m_tip_texture ?
|
||||
dual_brush->m_tip_texture->bind() :
|
||||
unbind_texture_2d();
|
||||
},
|
||||
[&] {
|
||||
[&](int) {
|
||||
dual_brush->m_tip_texture ?
|
||||
dual_brush->m_tip_texture->unbind() :
|
||||
unbind_texture_2d();
|
||||
}));
|
||||
},
|
||||
0));
|
||||
},
|
||||
.setup_dual_shader = [&] {
|
||||
pp::panopainter::setup_legacy_stroke_dual_shader(
|
||||
|
||||
@@ -116,6 +116,22 @@ struct LegacyCanvasStrokeTextureInputDispatch {
|
||||
};
|
||||
}
|
||||
|
||||
[[nodiscard]] inline LegacyCanvasStrokeTextureInputDispatch make_legacy_canvas_stroke_brush_tip_texture_dispatch(
|
||||
std::function<void(int)> activate_texture_unit,
|
||||
std::function<void(int)> bind_brush_tip,
|
||||
std::function<void(int)> unbind_brush_tip,
|
||||
int face_index)
|
||||
{
|
||||
return make_legacy_canvas_stroke_brush_tip_texture_dispatch(
|
||||
std::move(activate_texture_unit),
|
||||
[bind_brush_tip = std::move(bind_brush_tip), face_index]() {
|
||||
bind_brush_tip(face_index);
|
||||
},
|
||||
[unbind_brush_tip = std::move(unbind_brush_tip), face_index]() {
|
||||
unbind_brush_tip(face_index);
|
||||
});
|
||||
}
|
||||
|
||||
[[nodiscard]] inline LegacyCanvasStrokeTextureInputDispatch make_legacy_canvas_stroke_destination_texture_dispatch(
|
||||
std::function<void(int)> activate_texture_unit,
|
||||
std::function<void()> bind_stroke_destination,
|
||||
|
||||
Reference in New Issue
Block a user