Extract pad destination dispatch helper
This commit is contained in:
@@ -1052,6 +1052,18 @@ void Canvas::stroke_draw()
|
||||
.slot = 1,
|
||||
},
|
||||
};
|
||||
const auto pad_destination_texture_dispatch =
|
||||
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();
|
||||
},
|
||||
0);
|
||||
[[maybe_unused]] const auto pad_result = pp::panopainter::execute_legacy_canvas_stroke_pad_face_callbacks(
|
||||
pad_faces,
|
||||
stroke_extent,
|
||||
@@ -1067,17 +1079,7 @@ void Canvas::stroke_draw()
|
||||
[&](int face_index) {
|
||||
pp::panopainter::bind_legacy_canvas_stroke_texture_inputs(
|
||||
pad_destination_texture_binding,
|
||||
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));
|
||||
pad_destination_texture_dispatch);
|
||||
},
|
||||
[&](const pp::paint_renderer::CanvasStrokeCopyRegion& copy_region) {
|
||||
pp::panopainter::execute_legacy_canvas_stroke_pad_copy_region(
|
||||
@@ -1087,17 +1089,7 @@ void Canvas::stroke_draw()
|
||||
[&](int face_index) {
|
||||
pp::panopainter::unbind_legacy_canvas_stroke_texture_inputs(
|
||||
pad_destination_texture_binding,
|
||||
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));
|
||||
pad_destination_texture_dispatch);
|
||||
},
|
||||
[&] {
|
||||
m_brush_shape.draw_fill();
|
||||
|
||||
Reference in New Issue
Block a user