Flutter Engine
The Flutter Engine
|
#include <frame_timings.h>
Public Types | |
enum class | State : uint32_t { kUninitialized , kVsync , kBuildStart , kBuildEnd , kRasterStart , kRasterEnd } |
Public Member Functions | |
FrameTimingsRecorder () | |
Default constructor, initializes the recorder with State::kUninitialized. More... | |
FrameTimingsRecorder (uint64_t frame_number) | |
Constructor with a pre-populated frame number. More... | |
~FrameTimingsRecorder () | |
fml::TimePoint | GetVsyncStartTime () const |
Timestamp of the vsync signal. More... | |
fml::TimePoint | GetVsyncTargetTime () const |
fml::TimePoint | GetBuildStartTime () const |
Timestamp of when the frame building started. More... | |
fml::TimePoint | GetBuildEndTime () const |
Timestamp of when the frame was finished building. More... | |
fml::TimePoint | GetRasterStartTime () const |
Timestamp of when the frame rasterization started. More... | |
fml::TimePoint | GetRasterEndTime () const |
Timestamp of when the frame rasterization finished. More... | |
fml::TimePoint | GetRasterEndWallTime () const |
Timestamp of when the frame rasterization is complete in wall-time. More... | |
fml::TimeDelta | GetBuildDuration () const |
Duration of the frame build time. More... | |
size_t | GetLayerCacheCount () const |
Count of the layer cache entries. More... | |
size_t | GetLayerCacheBytes () const |
Total Bytes in all layer cache entries. More... | |
size_t | GetPictureCacheCount () const |
Count of the picture cache entries. More... | |
size_t | GetPictureCacheBytes () const |
Total Bytes in all picture cache entries. More... | |
void | RecordVsync (fml::TimePoint vsync_start, fml::TimePoint vsync_target) |
Records a vsync event. More... | |
void | RecordBuildStart (fml::TimePoint build_start) |
Records a build start event. More... | |
void | RecordBuildEnd (fml::TimePoint build_end) |
Records a build end event. More... | |
void | RecordRasterStart (fml::TimePoint raster_start) |
Records a raster start event. More... | |
std::unique_ptr< FrameTimingsRecorder > | CloneUntil (State state) |
Clones the recorder until (and including) the specified state. More... | |
FrameTiming | RecordRasterEnd (const RasterCache *cache=nullptr) |
uint64_t | GetFrameNumber () const |
const char * | GetFrameNumberTraceArg () const |
Returns the frame number in a fml tracing friendly format. More... | |
FrameTiming | GetRecordedTime () const |
Returns the recorded time from when RecordRasterEnd is called. More... | |
void | AssertInState (State state) const |
Records timestamps for various phases of a frame rendering process.
Recorder is created on vsync and destroyed after the rasterization of the frame. This class is thread safe and doesn't require additional synchronization.
Definition at line 30 of file frame_timings.h.
|
strong |
Various states that the recorder can be in. When created the recorder is in an unitialized state and transtions in sequential order of the states.
Enumerator | |
---|---|
kUninitialized | |
kVsync | |
kBuildStart | |
kBuildEnd | |
kRasterStart | |
kRasterEnd |
Definition at line 35 of file frame_timings.h.
flutter::FrameTimingsRecorder::FrameTimingsRecorder | ( | ) |
Default constructor, initializes the recorder with State::kUninitialized.
Definition at line 43 of file frame_timings.cc.
|
explicit |
Constructor with a pre-populated frame number.
Definition at line 47 of file frame_timings.cc.
|
default |
void flutter::FrameTimingsRecorder::AssertInState | ( | State | state | ) | const |
Asserts in unopt builds that the recorder is current at the specified state.
Instead of adding a GetState
method and asserting on the result, this method prevents other logic from relying on the state.
In release builds, this call is a no-op.
Definition at line 284 of file frame_timings.cc.
std::unique_ptr< FrameTimingsRecorder > flutter::FrameTimingsRecorder::CloneUntil | ( | State | state | ) |
Clones the recorder until (and including) the specified state.
Definition at line 239 of file frame_timings.cc.
fml::TimeDelta flutter::FrameTimingsRecorder::GetBuildDuration | ( | ) | const |
Duration of the frame build time.
Definition at line 95 of file frame_timings.cc.
fml::TimePoint flutter::FrameTimingsRecorder::GetBuildEndTime | ( | ) | const |
Timestamp of when the frame was finished building.
Definition at line 71 of file frame_timings.cc.
fml::TimePoint flutter::FrameTimingsRecorder::GetBuildStartTime | ( | ) | const |
Timestamp of when the frame building started.
Definition at line 65 of file frame_timings.cc.
uint64_t flutter::FrameTimingsRecorder::GetFrameNumber | ( | ) | const |
Returns the frame number. Frame number is unique per frame and a frame built earlier will have a frame number less than a frame that has been built at a later point of time.
Definition at line 276 of file frame_timings.cc.
const char * flutter::FrameTimingsRecorder::GetFrameNumberTraceArg | ( | ) | const |
Returns the frame number in a fml tracing friendly format.
Definition at line 280 of file frame_timings.cc.
size_t flutter::FrameTimingsRecorder::GetLayerCacheBytes | ( | ) | const |
Total Bytes in all layer cache entries.
Total bytes in all layer cache entries.
Definition at line 109 of file frame_timings.cc.
size_t flutter::FrameTimingsRecorder::GetLayerCacheCount | ( | ) | const |
Count of the layer cache entries.
Definition at line 102 of file frame_timings.cc.
size_t flutter::FrameTimingsRecorder::GetPictureCacheBytes | ( | ) | const |
Total Bytes in all picture cache entries.
Total bytes in all picture cache entries.
Definition at line 123 of file frame_timings.cc.
size_t flutter::FrameTimingsRecorder::GetPictureCacheCount | ( | ) | const |
Count of the picture cache entries.
Definition at line 116 of file frame_timings.cc.
fml::TimePoint flutter::FrameTimingsRecorder::GetRasterEndTime | ( | ) | const |
Timestamp of when the frame rasterization finished.
Definition at line 83 of file frame_timings.cc.
fml::TimePoint flutter::FrameTimingsRecorder::GetRasterEndWallTime | ( | ) | const |
Timestamp of when the frame rasterization is complete in wall-time.
Definition at line 89 of file frame_timings.cc.
fml::TimePoint flutter::FrameTimingsRecorder::GetRasterStartTime | ( | ) | const |
Timestamp of when the frame rasterization started.
Definition at line 77 of file frame_timings.cc.
FrameTiming flutter::FrameTimingsRecorder::GetRecordedTime | ( | ) | const |
Returns the recorded time from when RecordRasterEnd
is called.
Definition at line 233 of file frame_timings.cc.
fml::TimePoint flutter::FrameTimingsRecorder::GetVsyncStartTime | ( | ) | const |
Timestamp of the vsync signal.
Definition at line 53 of file frame_timings.cc.
fml::TimePoint flutter::FrameTimingsRecorder::GetVsyncTargetTime | ( | ) | const |
Timestamp of when the frame was targeted to be presented.
This is typically the next vsync signal timestamp.
Definition at line 59 of file frame_timings.cc.
void flutter::FrameTimingsRecorder::RecordBuildEnd | ( | fml::TimePoint | build_end | ) |
Records a build end event.
Definition at line 142 of file frame_timings.cc.
void flutter::FrameTimingsRecorder::RecordBuildStart | ( | fml::TimePoint | build_start | ) |
Records a build start event.
Definition at line 136 of file frame_timings.cc.
FrameTiming flutter::FrameTimingsRecorder::RecordRasterEnd | ( | const RasterCache * | cache = nullptr | ) |
Records a raster end event, and builds a FrameTiming
that summarizes all the events. This summary is sent to the framework.
Definition at line 202 of file frame_timings.cc.
void flutter::FrameTimingsRecorder::RecordRasterStart | ( | fml::TimePoint | raster_start | ) |
Records a raster start event.
Definition at line 148 of file frame_timings.cc.
void flutter::FrameTimingsRecorder::RecordVsync | ( | fml::TimePoint | vsync_start, |
fml::TimePoint | vsync_target | ||
) |
Records a vsync event.
Definition at line 129 of file frame_timings.cc.