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, .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( const auto result = pp::panopainter::execute_legacy_canvas_stroke_face_sample_polygon(
make_stroke_draw_samples_request( make_stroke_draw_samples_request(
i, i,
P, P,
copy_stroke_destination), copy_stroke_destination),
destination_texture_binding, destination_texture_binding,
destination_texture_dispatch); make_stroke_draw_samples_destination_texture_dispatch(i));
return result.dirty_bounds; 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( pp::panopainter::LegacyStrokeFaceSamplePolygonExecutionRequest Canvas::make_stroke_draw_samples_request(
int face_index, int face_index,
std::vector<vertex_t>& polygon_vertices, std::vector<vertex_t>& polygon_vertices,

View File

@@ -283,6 +283,8 @@ private:
int face_index, int face_index,
std::vector<vertex_t>& polygon_vertices, std::vector<vertex_t>& polygon_vertices,
bool copy_stroke_destination) const; bool copy_stroke_destination) const;
pp::panopainter::LegacyCanvasStrokeTextureInputDispatch make_stroke_draw_samples_destination_texture_dispatch(
int face_index);
void stroke_draw_dual_pass( void stroke_draw_dual_pass(
const std::vector<StrokeFrame>& frames_dual, const std::vector<StrokeFrame>& frames_dual,
const std::array<pp::panopainter::LegacyCanvasStrokeTextureBinding, 1>& dual_pass_texture_bindings, const std::array<pp::panopainter::LegacyCanvasStrokeTextureBinding, 1>& dual_pass_texture_bindings,