5#ifndef FLUTTER_FLOW_STOPWATCH_H_
6#define FLUTTER_FLOW_STOPWATCH_H_
10#include "flutter/display_list/dl_canvas.h"
11#include "flutter/fml/macros.h"
12#include "flutter/fml/time/time_delta.h"
13#include "flutter/fml/time/time_point.h"
58 std::vector<fml::TimeDelta> laps_;
59 size_t current_sample_ = 0;
118 double UnitHeight(
double time_ms,
double max_height)
const;
Developer-facing API for rendering anything within the engine.
Used for fixed refresh rate cases.
FixedRefreshRateStopwatch(fml::Milliseconds fixed_frame_budget=fml::kDefaultFrameBudget)
Used for fixed refresh rate query cases.
FixedRefreshRateUpdater(fml::Milliseconds fixed_frame_budget=fml::kDefaultFrameBudget)
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_
virtual void Visualize(DlCanvas *canvas, const SkRect &rect) const =0
Renders the stopwatch as a graph.
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)
FML_DISALLOW_COPY_AND_ASSIGN(StopwatchVisualizer)
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)
Stopwatch(const RefreshRateUpdater &updater)
fml::TimeDelta AverageDelta() const
sk_sp< SkBlender > blender SkRect rect
std::chrono::duration< double, std::milli > Milliseconds
constexpr Milliseconds kDefaultFrameBudget