Reuse stroke brush tip dispatch helper
This commit is contained in:
@@ -926,16 +926,20 @@ void Canvas::stroke_draw()
|
||||
.bind_brush_tip = [&] {
|
||||
pp::panopainter::bind_legacy_canvas_stroke_texture_inputs(
|
||||
dual_pass_texture_bindings,
|
||||
pp::panopainter::LegacyCanvasStrokeTextureInputDispatch {
|
||||
.activate_texture_unit = [&](int texture_slot) {
|
||||
pp::panopainter::make_legacy_canvas_stroke_brush_tip_texture_dispatch(
|
||||
[&](int texture_slot) {
|
||||
set_active_texture_unit(texture_slot);
|
||||
},
|
||||
.bind_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->unbind() :
|
||||
unbind_texture_2d();
|
||||
}));
|
||||
},
|
||||
.execute_frame_pass = [&] {
|
||||
pp::panopainter::execute_legacy_canvas_stroke_live_pass_with_face_framebuffers(
|
||||
@@ -962,16 +966,20 @@ void Canvas::stroke_draw()
|
||||
.unbind_brush_tip = [&] {
|
||||
pp::panopainter::unbind_legacy_canvas_stroke_texture_inputs(
|
||||
dual_pass_texture_bindings,
|
||||
pp::panopainter::LegacyCanvasStrokeTextureInputDispatch {
|
||||
.activate_texture_unit = [&](int texture_slot) {
|
||||
pp::panopainter::make_legacy_canvas_stroke_brush_tip_texture_dispatch(
|
||||
[&](int 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->unbind() :
|
||||
unbind_texture_2d();
|
||||
},
|
||||
});
|
||||
}));
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user