Extract pad stroke face orchestration

This commit is contained in:
2026-06-13 18:01:45 +02:00
parent 9bbc24b075
commit 11a62e9b43
5 changed files with 145 additions and 44 deletions

View File

@@ -858,46 +858,42 @@ void Canvas::stroke_draw()
m_tex[face_index].unbind();
});
};
[[maybe_unused]] const auto pad_result = pp::panopainter::execute_legacy_canvas_stroke_pad_faces(
pp::panopainter::LegacyCanvasStrokePadExecutionRequest {
.context = "Canvas::stroke_draw",
.extent = stroke_extent,
.faces = pad_faces,
.copy_stroke_destination = copy_stroke_destination,
.upload_pad_vertices = [&](std::span<const vertex_t> pad_quad) {
m_brush_shape.update_vertices(
const_cast<vertex_t*>(pad_quad.data()),
static_cast<int>(pad_quad.size()));
},
.begin_face = [&](int face_index) {
m_tmp[face_index].bindFramebuffer();
},
.bind_destination_texture = [&](int face_index) {
pp::panopainter::bind_legacy_canvas_stroke_texture_inputs(
pad_destination_texture_binding,
make_pad_destination_texture_dispatch(face_index));
},
.copy_framebuffer_to_destination_texture =
[&](const pp::paint_renderer::CanvasStrokeCopyRegion& copy_region) {
copy_framebuffer_to_texture_2d(
copy_region.x,
copy_region.y,
copy_region.x,
copy_region.y,
copy_region.width,
copy_region.height);
},
.unbind_destination_texture = [&](int face_index) {
pp::panopainter::unbind_legacy_canvas_stroke_texture_inputs(
pad_destination_texture_binding,
make_pad_destination_texture_dispatch(face_index));
},
.draw_pad = [&] {
m_brush_shape.draw_fill();
},
.finish_face = [&](int face_index) {
m_tmp[face_index].unbindFramebuffer();
},
[[maybe_unused]] const auto pad_result = pp::panopainter::execute_legacy_canvas_stroke_pad_face_callbacks(
pad_faces,
stroke_extent,
copy_stroke_destination,
[&](std::span<const vertex_t> pad_quad) {
m_brush_shape.update_vertices(
const_cast<vertex_t*>(pad_quad.data()),
static_cast<int>(pad_quad.size()));
},
[&](int face_index) {
m_tmp[face_index].bindFramebuffer();
},
[&](int face_index) {
pp::panopainter::bind_legacy_canvas_stroke_texture_inputs(
pad_destination_texture_binding,
make_pad_destination_texture_dispatch(face_index));
},
[&](const pp::paint_renderer::CanvasStrokeCopyRegion& copy_region) {
copy_framebuffer_to_texture_2d(
copy_region.x,
copy_region.y,
copy_region.x,
copy_region.y,
copy_region.width,
copy_region.height);
},
[&](int face_index) {
pp::panopainter::unbind_legacy_canvas_stroke_texture_inputs(
pad_destination_texture_binding,
make_pad_destination_texture_dispatch(face_index));
},
[&] {
m_brush_shape.draw_fill();
},
[&](int face_index) {
m_tmp[face_index].unbindFramebuffer();
});
// DRAW DUAL BRUSH