Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Instance Methods | List of all members
VSyncClient(Testing) Category Reference

Instance Methods

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

Detailed Description

Definition at line 182 of file FlutterViewControllerTest.mm.

Method Documentation

◆ getDisplayLink [1/2]

- (CADisplayLink *) getDisplayLink

Extends class VSyncClient.

Definition at line 63 of file vsync_waiter_ios.mm.

139 {
140 return _displayLink;
141}
CADisplayLink * _displayLink

◆ getDisplayLink [2/2]

- (CADisplayLink *) getDisplayLink

◆ onDisplayLink:

- (void) onDisplayLink: (CADisplayLink *)  link

Extends class VSyncClient.

Definition at line 63 of file vsync_waiter_ios.mm.

111 :(CADisplayLink*)link {
112 CFTimeInterval delay = CACurrentMediaTime() - link.timestamp;
113 fml::TimePoint frame_start_time = fml::TimePoint::Now() - fml::TimeDelta::FromSecondsF(delay);
114
115 CFTimeInterval duration = link.targetTimestamp - link.timestamp;
116 fml::TimePoint frame_target_time = frame_start_time + fml::TimeDelta::FromSecondsF(duration);
117
118 TRACE_EVENT2_INT("flutter", "PlatformVsync", "frame_start_time",
119 frame_start_time.ToEpochDelta().ToMicroseconds(), "frame_target_time",
120 frame_target_time.ToEpochDelta().ToMicroseconds());
121
122 std::unique_ptr<flutter::FrameTimingsRecorder> recorder =
123 std::make_unique<flutter::FrameTimingsRecorder>();
124
125 _refreshRate = round(1 / (frame_target_time - frame_start_time).ToSecondsF());
126
127 recorder->RecordVsync(frame_start_time, frame_target_time);
128 if (_allowPauseAfterVsync) {
129 link.paused = YES;
130 }
131 _callback(std::move(recorder));
132}
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
link(from_root, to_root)
Definition dart_pkg.py:44
#define TRACE_EVENT2_INT(category_group, name, arg1_name, arg1_val, arg2_name, arg2_val)

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