Extract stroke draw samples destination dispatch

This commit is contained in:
2026-06-13 23:45:46 +02:00
parent ffb653fc6e
commit 3c3405d796
2 changed files with 18 additions and 12 deletions

View File

@@ -747,28 +747,32 @@ glm::vec4 Canvas::stroke_draw_samples(
.slot = 1,
},
};
const auto destination_texture_dispatch =
pp::panopainter::make_legacy_canvas_stroke_destination_texture_dispatch(
[&](int texture_slot) {
set_active_texture_unit(texture_slot);
},
[&] {
m_tex[i].bind(); // bg, copy of framebuffer (copied before drawing)
},
[&] {
m_tex[i].unbind();
});
const auto result = pp::panopainter::execute_legacy_canvas_stroke_face_sample_polygon(
make_stroke_draw_samples_request(
i,
P,
copy_stroke_destination),
destination_texture_binding,
destination_texture_dispatch);
make_stroke_draw_samples_destination_texture_dispatch(i));
return result.dirty_bounds;
}
pp::panopainter::LegacyCanvasStrokeTextureInputDispatch Canvas::make_stroke_draw_samples_destination_texture_dispatch(
int face_index)
{
return pp::panopainter::make_legacy_canvas_stroke_destination_texture_dispatch(
[&](int texture_slot) {
set_active_texture_unit(texture_slot);
},
[&, face_index] {
m_tex[face_index].bind(); // bg, copy of framebuffer (copied before drawing)
},
[&, face_index] {
m_tex[face_index].unbind();
});
}
pp::panopainter::LegacyStrokeFaceSamplePolygonExecutionRequest Canvas::make_stroke_draw_samples_request(
int face_index,
std::vector<vertex_t>& polygon_vertices,