34 void draw_recording_toolbar();
35 void draw_frame_selector_bar();
38 void draw_time_ruler(
double view_start_ns,
double reference_ns,
double ns_per_pixel,
39 float ruler_width, ImVec2 canvas_pos);
42 const std::vector<const frame_snapshot*>& visible_frames,
43 const std::vector<uint32_t>& visible_hist_indices,
45 uint16_t thread_index,
46 const std::string& thread_name);
48 static void timeline_render_event_block(
const lane_context& lc,
50 bool is_reference_frame,
51 const std::string& thread_name,
53 uint32_t hist_frame_idx,
57 void validate_timeline_scope_selection(uint32_t frame_count);
59 [[nodiscard]]
auto is_timeline_scope_selected(uint32_t hist_frame,
60 uint16_t thread_index,
61 uint32_t event_index)
const ->
bool
63 return has_timeline_scope_selection_ && selected_scope_hist_frame_ == hist_frame &&
64 selected_scope_thread_index_ == thread_index && selected_scope_event_index_ == event_index;
67 void set_timeline_scope_selection(uint32_t hist_frame,
68 uint16_t thread_index,
72 has_timeline_scope_selection_ =
true;
73 selected_scope_hist_frame_ = hist_frame;
74 selected_scope_thread_index_ = thread_index;
75 selected_scope_event_index_ = event_index;
76 selected_scope_label_ = label ? label :
"";
78 void draw_lane_frame_boundaries(
const lane_context& lc,
79 const std::vector<const frame_snapshot*>& visible_frames,
80 const frame_snapshot* selected_snap);
81 void gather_visible_frames(performance_profiler* profiler,
83 const frame_snapshot* selected_snap,
84 std::vector<const frame_snapshot*>& out);
93 static void collect_unique_threads(
const std::vector<const frame_snapshot*>& frames,
94 std::vector<thread_entry>& out);
96 void draw_aggregate_section();
97 void draw_frame_histogram(performance_profiler* profiler, uint32_t frame_count,
float bar_width);
98 void draw_live_histogram_stack(
float bar_width);
100 [[nodiscard]]
auto histogram_stack_height() const ->
float;
101 void handle_histogram_input(performance_profiler* profiler, uint32_t frame_count,
102 ImVec2 canvas_pos,
float bar_width,
103 float eff_start,
float eff_range);
104 void handle_histogram_zoom_pan(uint32_t frame_count, ImVec2 canvas_pos,
105 float bar_width,
float eff_start,
float eff_range);
108 imgui_panels* parent_{
nullptr};
117 bool show_histogram_managed_heap_{
false};
118 bool show_histogram_gpu_memory_{
false};
119 bool show_histogram_process_rss_{
false};
121 double view_start_ns_{0.0};
122 double view_duration_ns_{20'000'000.0};
123 int32_t last_centered_frame_{-2};
125 int32_t selected_frame_{-1};
126 bool auto_follow_{
true};
127 bool is_dragging_cursor_{
false};
129 float hist_start_{0.0f};
130 float hist_range_{0.0f};
132 bool show_request_{};
135 bool has_timeline_scope_selection_{
false};
136 uint32_t selected_scope_hist_frame_{0};
137 uint16_t selected_scope_thread_index_{0};
138 uint32_t selected_scope_event_index_{0};
139 std::string selected_scope_label_{};