5#ifndef FLUTTER_FLOW_STOPWATCH_H_
6#define FLUTTER_FLOW_STOPWATCH_H_
61 std::vector<fml::TimeDelta> laps_;
121 double UnitHeight(
double time_ms,
double max_height)
const;
Developer-facing API for rendering anything within the engine.
Used for fixed refresh rate cases.
Used for fixed refresh rate query cases.
The refresh rate interface for Stopwatch.
virtual fml::Milliseconds GetFrameBudget() const =0
const fml::TimeDelta & GetLap(size_t index) const
const fml::TimeDelta & LastLap() const
fml::Milliseconds GetFrameBudget() const
All places which want to get frame_budget should call this function.
fml::TimeDelta MaxDelta() const
size_t GetLapsCount() const
Return a reference to all the laps.
size_t GetCurrentSample() const
void SetLapTime(const fml::TimeDelta &delta)
static const size_t kMaxSamples
fml::TimeDelta AverageDelta() const
Abstract class for visualizing (i.e. drawing) a stopwatch.
double UnitHeight(double time_ms, double max_height) const
Converts a raster time to a unit height.
const Stopwatch & stopwatch_
fml::Milliseconds GetFrameBudget() const
fml::Milliseconds frame_budget_
double UnitFrameInterval(double time_ms) const
Converts a raster time to a unit interval.
virtual ~StopwatchVisualizer()=default
StopwatchVisualizer(const Stopwatch &stopwatch)
virtual void Visualize(DlCanvas *canvas, const DlRect &rect) const =0
Renders the stopwatch as a graph.
FML_DISALLOW_COPY_AND_ASSIGN(StopwatchVisualizer)
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
std::chrono::duration< double, std::milli > Milliseconds
constexpr Milliseconds kDefaultFrameBudget