mirror of
https://github.com/RGBCube/serenity
synced 2025-05-18 07:55:07 +00:00

While structs being forward declared as classes is not strictly an issue, Clang complains as this is not portable code, since some ABIs treat classes declared as `class` and `struct` differently. It's easier to fix these than to reason about explicitly disabling another warning.
52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "Histogram.h"
|
|
#include <LibGUI/Frame.h>
|
|
|
|
namespace Profiler {
|
|
|
|
struct Process;
|
|
class Profile;
|
|
class TimelineView;
|
|
|
|
class TimelineTrack final : public GUI::Frame {
|
|
C_OBJECT(TimelineTrack);
|
|
|
|
public:
|
|
virtual ~TimelineTrack() override;
|
|
|
|
void set_scale(float);
|
|
|
|
private:
|
|
virtual void event(Core::Event&) override;
|
|
virtual void paint_event(GUI::PaintEvent&) override;
|
|
|
|
struct HistogramInputs {
|
|
bool operator==(HistogramInputs const&) const = default;
|
|
u64 start { 0 };
|
|
u64 end { 0 };
|
|
size_t columns { 0 };
|
|
};
|
|
|
|
void recompute_histograms_if_needed(HistogramInputs const&);
|
|
|
|
explicit TimelineTrack(TimelineView const&, Profile const&, Process const&);
|
|
|
|
TimelineView const& m_view;
|
|
Profile const& m_profile;
|
|
Process const& m_process;
|
|
|
|
HistogramInputs m_cached_histogram_inputs;
|
|
|
|
Optional<Histogram<u64>> m_kernel_histogram;
|
|
Optional<Histogram<u64>> m_user_histogram;
|
|
decltype(m_kernel_histogram->at(0)) m_max_value { 0 };
|
|
};
|
|
|
|
}
|