5#ifndef FLUTTER_FLOW_FRAME_TIMINGS_H_
6#define FLUTTER_FLOW_FRAME_TIMINGS_H_
17#define TRACE_EVENT_WITH_FRAME_NUMBER(recorder, category_group, name, \
18 flow_id_count, flow_ids) \
19 TRACE_EVENT1_WITH_FLOW_IDS(category_group, name, flow_id_count, flow_ids, \
21 recorder->GetFrameNumberTraceArg())
130 FML_FRIEND_TEST(FrameTimingsRecorderTest, ThrowWhenRecordBuildBeforeVsync);
132 ThrowWhenRecordRasterBeforeBuildEnd);
140 static std::atomic<uint64_t> frame_number_gen_;
142 mutable std::mutex state_mutex_;
145 const uint64_t frame_number_;
146 const std::string frame_number_trace_arg_val_;
156 size_t layer_cache_count_;
157 size_t layer_cache_bytes_;
158 size_t picture_cache_count_;
159 size_t picture_cache_bytes_;
void RecordBuildStart(fml::TimePoint build_start)
Records a build start event.
FrameTiming RecordRasterEnd(const RasterCache *cache=nullptr)
fml::TimePoint GetVsyncStartTime() const
Timestamp of the vsync signal.
fml::TimePoint GetBuildEndTime() const
Timestamp of when the frame was finished building.
fml::TimePoint GetRasterEndTime() const
Timestamp of when the frame rasterization finished.
void RecordRasterStart(fml::TimePoint raster_start)
Records a raster start event.
std::unique_ptr< FrameTimingsRecorder > CloneUntil(State state)
Clones the recorder until (and including) the specified state.
void AssertInState(State state) const
size_t GetPictureCacheCount() const
Count of the picture cache entries.
fml::TimePoint GetRasterEndWallTime() const
Timestamp of when the frame rasterization is complete in wall-time.
size_t GetLayerCacheBytes() const
Total Bytes in all layer cache entries.
void RecordVsync(fml::TimePoint vsync_start, fml::TimePoint vsync_target)
Records a vsync event.
fml::TimePoint GetVsyncTargetTime() const
size_t GetPictureCacheBytes() const
Total Bytes in all picture cache entries.
size_t GetLayerCacheCount() const
Count of the layer cache entries.
void RecordBuildEnd(fml::TimePoint build_end)
Records a build end event.
FrameTimingsRecorder()
Default constructor, initializes the recorder with State::kUninitialized.
fml::TimePoint GetBuildStartTime() const
Timestamp of when the frame building started.
const char * GetFrameNumberTraceArg() const
Returns the frame number in a fml tracing friendly format.
fml::TimePoint GetRasterStartTime() const
Timestamp of when the frame rasterization started.
uint64_t GetFrameNumber() const
FrameTiming GetRecordedTime() const
Returns the recorded time from when RecordRasterEnd is called.
fml::TimeDelta GetBuildDuration() const
Duration of the frame build time.
#define FML_DISALLOW_COPY_ASSIGN_AND_MOVE(TypeName)
#define FML_FRIEND_TEST(test_case_name, test_name)