feat(render): Renderer with LOD selection, 3.3 and 4.3+ upload paths, headless smoke test

This commit is contained in:
Martino Ferrari committed 2026-09-27 23:03:08 +02:00
1 parent e0cdd95a3b
commit 3555ab63d7
20 files changed
+1544 -25

No files matched your search

+24
View File
@@ -43,6 +43,30 @@ PLOT_TEST(line_batch_stages_segment_endpoints) {
PLOT_CHECK_NEAR(b.data()[7], 1.0, 0.0);
}
// `add_polyline_xy` takes the layout `Series::gather` appends to, so this pins
// that a gathered window becomes the segments it says it does -- an off-by-one in
// the stride here would draw a diagonal where the data has a corner.
PLOT_TEST(line_batch_stages_interleaved_points) {
plot::render::LineBatch b;
b.begin();
const plot::f32 xy[8] = {0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f};
b.add_polyline_xy(xy, 4); // 3 segments
PLOT_CHECK(b.segment_count() == 3);
PLOT_CHECK(b.vertex_count() == 6);
PLOT_CHECK(b.data().size() == 12);
PLOT_CHECK_NEAR(b.data()[0], 0.0, 0.0);
PLOT_CHECK_NEAR(b.data()[1], 1.0, 0.0);
PLOT_CHECK_NEAR(b.data()[2], 2.0, 0.0);
PLOT_CHECK_NEAR(b.data()[3], 3.0, 0.0);
PLOT_CHECK_NEAR(b.data()[10], 6.0, 0.0);
PLOT_CHECK_NEAR(b.data()[11], 7.0, 0.0);
// Fewer than two points, or none: nothing to draw, and nothing to crash on.
b.clear();
b.add_polyline_xy(xy, 1);
b.add_polyline_xy(nullptr, 4);
PLOT_CHECK(b.vertex_count() == 0);
}
PLOT_TEST(line_batch_ignores_degenerate_polylines) {
plot::render::LineBatch b;
b.begin();