Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Instance Methods | List of all members
VSyncClient(Testing) Category Reference

Instance Methods

(CADisplayLink *) - getDisplayLink
 
(CADisplayLink *) - getDisplayLink
 
(void) - onDisplayLink:
 

Detailed Description

Definition at line 183 of file FlutterViewControllerTest.mm.

Method Documentation

◆ getDisplayLink [1/2]

- (CADisplayLink *) getDisplayLink

Extends class VSyncClient.

Definition at line 66 of file vsync_waiter_ios.mm.

142 {
143 return _displayLink;
144}
CADisplayLink * _displayLink

◆ getDisplayLink [2/2]

- (CADisplayLink *) getDisplayLink

◆ onDisplayLink:

- (void) onDisplayLink: (CADisplayLink *)  link

Extends class VSyncClient.

Definition at line 66 of file vsync_waiter_ios.mm.

114 :(CADisplayLink*)link {
115 CFTimeInterval delay = CACurrentMediaTime() - link.timestamp;
116 fml::TimePoint frame_start_time = fml::TimePoint::Now() - fml::TimeDelta::FromSecondsF(delay);
117
118 CFTimeInterval duration = link.targetTimestamp - link.timestamp;
119 fml::TimePoint frame_target_time = frame_start_time + fml::TimeDelta::FromSecondsF(duration);
120
121 TRACE_EVENT2_INT("flutter", "PlatformVsync", "frame_start_time",
122 frame_start_time.ToEpochDelta().ToMicroseconds(), "frame_target_time",
123 frame_target_time.ToEpochDelta().ToMicroseconds());
124
125 std::unique_ptr<flutter::FrameTimingsRecorder> recorder =
126 std::make_unique<flutter::FrameTimingsRecorder>();
127
128 _refreshRate = round(1 / (frame_target_time - frame_start_time).ToSecondsF());
129
130 recorder->RecordVsync(frame_start_time, frame_target_time);
131 if (_allowPauseAfterVsync) {
132 link.paused = YES;
133 }
134 _callback(std::move(recorder));
135}
static void round(SkPoint *p)
constexpr int64_t ToMicroseconds() const
Definition: time_delta.h:62
TimeDelta ToEpochDelta() const
Definition: time_point.h:52
static TimePoint Now()
Definition: time_point.cc:49
double duration
Definition: examples.cpp:30
def link(from_root, to_root)
Definition: dart_pkg.py:44
Definition: ascii_trie.cc:9
#define TRACE_EVENT2_INT(category_group, name, arg1_name, arg1_val, arg2_name, arg2_val)
Definition: trace_event.h:202

The documentation for this category was generated from the following files: