Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/core/layout_calculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,14 @@ Layout_calculator::result_t Layout_calculator::calculate(const parameters_t& par
return params.format_timestamp_func(timestamp_ns, seconds_to_ns(step_seconds));
};

struct candidate_t
{
std::int64_t t;
float x0;
float x1;
float x_anchor;
};
std::vector<candidate_t> candidates;
std::vector<std::pair<float, float>> accepted;
std::vector<std::pair<float, float>> level;

Expand Down Expand Up @@ -677,14 +685,6 @@ Layout_calculator::result_t Layout_calculator::calculate(const parameters_t& par
}
}

struct cand
{
std::int64_t t;
float x0;
float x1;
float x_anchor;
};
std::vector<cand> candidates;
float right_vis = 0.0f;
float pixel_step = 0.0f;
float optimistic_width = 0.0f;
Expand All @@ -695,6 +695,7 @@ Layout_calculator::result_t Layout_calculator::calculate(const parameters_t& par
VNM_PLOT_PROFILE_SCOPE(
profiler,
"renderer.frame.calculate_layout.impl.cache_miss.pass1.horizontal_axis.step_prep");
candidates.clear();
candidates.reserve(64);

right_vis = float(params.usable_width + params.vbar_width);
Expand Down Expand Up @@ -789,7 +790,7 @@ Layout_calculator::result_t Layout_calculator::calculate(const parameters_t& par
break;
}

cand candidate{t, x, x, x};
candidate_t candidate{t, x, x, x};
// Use conservative width estimate for skip optimization.
// Must be at least as large as actual label width to avoid skipping visible labels.
const float skip_width = std::max(last_width, estimated_label_width);
Expand Down
8 changes: 5 additions & 3 deletions src/core/series_renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2266,19 +2266,21 @@ bool Series_renderer::rhi_prepare_series_primitive(
if (count == 0) {
return false;
}
const std::vector<builtin_segment_span_t> segment_spans =
std::vector<builtin_segment_span_t> computed_segment_spans =
is_dots
? std::vector<builtin_segment_span_t>{}
: builtin_segment_spans(window);
const bool has_segment_span = !segment_spans.empty();
const bool has_segment_span = !computed_segment_spans.empty();
if (!is_dots && !has_segment_span) {
return false;
}
// Hand the computed spans to the caller so the record pass can reuse them
// (empty for DOTS, which draw per-sample instances).
if (out_segment_spans) {
*out_segment_spans = segment_spans;
*out_segment_spans = std::move(computed_segment_spans);
}
const std::vector<builtin_segment_span_t>& segment_spans =
out_segment_spans ? *out_segment_spans : computed_segment_spans;

QRhiRenderTarget* rt = ctx.render_target;

Expand Down
Loading