Extract stroke draw samples request assembly

This commit is contained in:
2026-06-13 23:41:04 +02:00
parent 3d8f798412
commit 3acb2da300
2 changed files with 40 additions and 25 deletions

View File

@@ -759,11 +759,26 @@ glm::vec4 Canvas::stroke_draw_samples(
m_tex[i].unbind();
});
const auto result = pp::panopainter::execute_legacy_canvas_stroke_face_sample_polygon(
pp::panopainter::LegacyStrokeFaceSamplePolygonExecutionRequest {
make_stroke_draw_samples_request(
i,
P,
copy_stroke_destination),
destination_texture_binding,
destination_texture_dispatch);
return result.dirty_bounds;
}
pp::panopainter::LegacyStrokeFaceSamplePolygonExecutionRequest Canvas::make_stroke_draw_samples_request(
int face_index,
std::vector<vertex_t>& polygon_vertices,
bool copy_stroke_destination) const
{
return pp::panopainter::LegacyStrokeFaceSamplePolygonExecutionRequest {
.context = "Canvas::stroke_draw_samples",
.target_size = { m_width, m_height },
.polygon_vertices = P,
.face_index = i,
.polygon_vertices = polygon_vertices,
.face_index = face_index,
.copy_stroke_destination = copy_stroke_destination,
.copy_framebuffer_to_destination_texture = [](
int,
@@ -783,11 +798,7 @@ glm::vec4 Canvas::stroke_draw_samples(
.draw_brush_shape = [&](int) {
m_brush_shape.draw_fill();
},
},
destination_texture_binding,
destination_texture_dispatch);
return result.dirty_bounds;
};
}
template <typename BuildRequest>

View File

@@ -279,6 +279,10 @@ private:
void draw_merge_final_plane_composite(
const glm::mat4& ortho,
bool draw_checkerboard);
pp::panopainter::LegacyStrokeFaceSamplePolygonExecutionRequest make_stroke_draw_samples_request(
int face_index,
std::vector<vertex_t>& polygon_vertices,
bool copy_stroke_destination) const;
void stroke_draw_dual_pass(
const std::vector<StrokeFrame>& frames_dual,
const std::array<pp::panopainter::LegacyCanvasStrokeTextureBinding, 1>& dual_pass_texture_bindings,