1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:48:12 +00:00

ProfileViewer: Rename Profile::Sample => Profile::Event

This commit is contained in:
Andreas Kling 2020-03-02 20:02:45 +01:00
parent 251b7f3776
commit 8eaac171d7
4 changed files with 44 additions and 44 deletions

View file

@ -51,14 +51,14 @@ void ProfileTimelineWidget::paint_event(GUI::PaintEvent& event)
float column_width = (float)frame_inner_rect().width() / (float)m_profile.length_in_ms();
float frame_height = (float)frame_inner_rect().height() / (float)m_profile.deepest_stack_depth();
for (auto& sample : m_profile.samples()) {
u64 t = sample.timestamp - m_profile.first_timestamp();
for (auto& event : m_profile.events()) {
u64 t = event.timestamp - m_profile.first_timestamp();
int x = (int)((float)t * column_width);
int cw = max(1, (int)column_width);
int column_height = frame_inner_rect().height() - (int)((float)sample.frames.size() * frame_height);
int column_height = frame_inner_rect().height() - (int)((float)event.frames.size() * frame_height);
bool in_kernel = sample.in_kernel;
bool in_kernel = event.in_kernel;
Color color = in_kernel ? Color::from_rgb(0xc25e5a) : Color::from_rgb(0x5a65c2);
for (int i = 0; i < cw; ++i)
painter.draw_line({ x + i, frame_thickness() + column_height }, { x + i, height() - frame_thickness() * 2 }, color);