Extract pad destination dispatch overload

This commit is contained in:
2026-06-13 18:47:21 +02:00
parent 58885187ba
commit 819b0f31db
5 changed files with 69 additions and 14 deletions

View File

@@ -863,18 +863,6 @@ void Canvas::stroke_draw()
.slot = 1,
},
};
const auto make_pad_destination_texture_dispatch = [&](int face_index) {
return pp::panopainter::make_legacy_canvas_stroke_pad_destination_texture_dispatch(
[&](int texture_slot) {
set_active_texture_unit(texture_slot);
},
[&] {
m_tex[face_index].bind();
},
[&] {
m_tex[face_index].unbind();
});
};
[[maybe_unused]] const auto pad_result = pp::panopainter::execute_legacy_canvas_stroke_pad_face_callbacks(
pad_faces,
stroke_extent,
@@ -890,7 +878,17 @@ void Canvas::stroke_draw()
[&](int face_index) {
pp::panopainter::bind_legacy_canvas_stroke_texture_inputs(
pad_destination_texture_binding,
make_pad_destination_texture_dispatch(face_index));
pp::panopainter::make_legacy_canvas_stroke_pad_destination_texture_dispatch(
[&](int texture_slot) {
set_active_texture_unit(texture_slot);
},
[&](int dst_face_index) {
m_tex[dst_face_index].bind();
},
[&](int dst_face_index) {
m_tex[dst_face_index].unbind();
},
face_index));
},
[&](const pp::paint_renderer::CanvasStrokeCopyRegion& copy_region) {
copy_framebuffer_to_texture_2d(
@@ -904,7 +902,17 @@ void Canvas::stroke_draw()
[&](int face_index) {
pp::panopainter::unbind_legacy_canvas_stroke_texture_inputs(
pad_destination_texture_binding,
make_pad_destination_texture_dispatch(face_index));
pp::panopainter::make_legacy_canvas_stroke_pad_destination_texture_dispatch(
[&](int texture_slot) {
set_active_texture_unit(texture_slot);
},
[&](int dst_face_index) {
m_tex[dst_face_index].bind();
},
[&](int dst_face_index) {
m_tex[dst_face_index].unbind();
},
face_index));
},
[&] {
m_brush_shape.draw_fill();