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
17 changes: 16 additions & 1 deletion src/core/label_fade_tracker.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <algorithm>
#include <array>
#include <chrono>
#include <string>
#include <type_traits>
Expand Down Expand Up @@ -146,11 +147,25 @@ bool update_and_draw_faded_labels(
bool primary = false;
bool suppressed = false;
};
class Emitted_texts
{
public:
void push_back(emitted_text_t text) { m_values[m_count++] = text; }
auto begin() { return m_values.begin(); }
auto end() { return m_values.begin() + m_count; }
auto begin() const { return m_values.begin(); }
auto end() const { return m_values.begin() + m_count; }

private:
// A label only emits its previous and current text during a crossfade.
std::array<emitted_text_t, 2> m_values{};
std::size_t m_count = 0;
};
struct emitted_state_t
{
key_t key;
const std::string* final_text = nullptr;
std::vector<emitted_text_t> texts;
Emitted_texts texts;
};

bool any_active = false;
Expand Down
5 changes: 3 additions & 2 deletions src/core/series_renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,7 @@ void Series_renderer::prepare(
layer->z_order()});
}
}
// Sort by z_order before preparing. The global stable_sort of
// Sort by z_order before preparing. The global sort of
// prepared_draws below independently fixes the final record order, but
// this per-view sort is still load-bearing: it determines the order in
// which layers are *prepared*, which is a tested contract (a lower
Expand Down Expand Up @@ -1786,7 +1786,8 @@ void Series_renderer::prepare(
}
}

std::stable_sort(
// The unique insertion_order breaks all ties, so stability adds no ordering guarantee.
std::sort(
m_rhi_state->prepared_draws.begin(),
m_rhi_state->prepared_draws.end(),
[](const auto& a, const auto& b) {
Expand Down
Loading