diff options
author | Simon Wanner <skyrising@pvpctutorials.de> | 2022-03-24 11:56:46 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-24 14:35:47 +0100 |
commit | e72f59cd233a976188cc210fb0dffb7d18738b7d (patch) | |
tree | 518cef9a8011a16d177cdd594601c12692d36556 | |
parent | 3d80d389549a315fa9107585832add0dd9982695 (diff) | |
download | serenity-e72f59cd233a976188cc210fb0dffb7d18738b7d.zip |
Profiler: Render signposts behind histograms
Since signposts render along the full height they could hide CPU usage
spikes. This way that won't be an issue. :^)
-rw-r--r-- | Userland/DevTools/Profiler/TimelineTrack.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Userland/DevTools/Profiler/TimelineTrack.cpp b/Userland/DevTools/Profiler/TimelineTrack.cpp index 0028b8e4e3..4689a4d96d 100644 --- a/Userland/DevTools/Profiler/TimelineTrack.cpp +++ b/Userland/DevTools/Profiler/TimelineTrack.cpp @@ -64,6 +64,16 @@ void TimelineTrack::paint_event(GUI::PaintEvent& event) float column_width = this->column_width(); float frame_height = (float)frame_inner_rect().height() / (float)m_max_value; + for_each_signpost([&](auto& signpost) { + int x = (int)((float)(signpost.timestamp - start_of_trace) * column_width); + int y1 = frame_thickness(); + int y2 = height() - frame_thickness() * 2; + + painter.draw_line({ x, y1 }, { x, y2 }, Color::Magenta); + + return IterationDecision::Continue; + }); + for (size_t bucket = 0; bucket < m_kernel_histogram->size(); bucket++) { auto kernel_value = m_kernel_histogram->at(bucket); auto user_value = m_user_histogram->at(bucket); @@ -93,16 +103,6 @@ void TimelineTrack::paint_event(GUI::PaintEvent& event) int select_hover_x = (int)((float)(normalized_hover_time - start_of_trace) * column_width); painter.fill_rect({ select_start_x, frame_thickness(), select_end_x - select_start_x, height() - frame_thickness() * 2 }, Color(0, 0, 0, 60)); painter.fill_rect({ select_hover_x, frame_thickness(), 1, height() - frame_thickness() * 2 }, Color::NamedColor::Black); - - for_each_signpost([&](auto& signpost) { - int x = (int)((float)(signpost.timestamp - start_of_trace) * column_width); - int y1 = frame_thickness(); - int y2 = height() - frame_thickness() * 2; - - painter.draw_line({ x, y1 }, { x, y2 }, Color::Magenta); - - return IterationDecision::Continue; - }); } template<typename Callback> |