Flutter Engine
The Flutter Engine
Instance Methods | List of all members
flutter::VsyncWaiterIOS Class Referencefinal

#import <vsync_waiter_ios.h>

Inheritance diagram for flutter::VsyncWaiterIOS:
flutter::VsyncWaiter flutter::VariableRefreshRateReporter

Instance Methods

() - VsyncWaiterIOS
 
() - ~VsyncWaiterIOS
 
(double) - GetRefreshRate
 
(void) - AwaitVSync
 
- Instance Methods inherited from flutter::VsyncWaiter
virtual ~VsyncWaiter ()
 
void AsyncWaitForVsync (const Callback &callback)
 
void ScheduleSecondaryCallback (uintptr_t id, const fml::closure &callback)
 
- Instance Methods inherited from flutter::VariableRefreshRateReporter
 VariableRefreshRateReporter ()=default
 
virtual double GetRefreshRate () const =0
 
 FML_DISALLOW_COPY_AND_ASSIGN (VariableRefreshRateReporter)
 

Additional Inherited Members

- Public Types inherited from flutter::VsyncWaiter
using Callback = std::function< void(std::unique_ptr< FrameTimingsRecorder >)>
 
- Protected Member Functions inherited from flutter::VsyncWaiter
 VsyncWaiter (const TaskRunners &task_runners)
 
virtual void AwaitVSync ()=0
 
virtual void AwaitVSyncForSecondaryCallback ()
 
void FireCallback (fml::TimePoint frame_start_time, fml::TimePoint frame_target_time, bool pause_secondary_tasks=true)
 
- Protected Attributes inherited from flutter::VsyncWaiter
const TaskRunners task_runners_
 

Detailed Description

Definition at line 66 of file vsync_waiter_ios.h.

Constructor & Destructor Documentation

◆ VsyncWaiterIOS

- VsyncWaiterIOS: (const flutter::TaskRunners &)  task_runners

Definition at line 30 of file vsync_waiter_ios.mm.

31 : VsyncWaiter(task_runners) {
32 auto callback = [this](std::unique_ptr<flutter::FrameTimingsRecorder> recorder) {
33 const fml::TimePoint start_time = recorder->GetVsyncStartTime();
34 const fml::TimePoint target_time = recorder->GetVsyncTargetTime();
35 FireCallback(start_time, target_time, true);
36 };
37 client_ = [[VSyncClient alloc] initWithTaskRunner:task_runners_.GetUITaskRunner()
38 callback:callback];
39 max_refresh_rate_ = DisplayLinkManager.displayRefreshRate;
40}
VsyncWaiter(const TaskRunners &task_runners)
Definition: vsync_waiter.cc:21
void FireCallback(fml::TimePoint frame_start_time, fml::TimePoint frame_target_time, bool pause_secondary_tasks=true)
Definition: vsync_waiter.cc:87
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
double displayRefreshRate
The display refresh rate used for reporting purposes. The engine does not care about this for frame s...

◆ ~VsyncWaiterIOS

- VsyncWaiterIOS:

Definition at line 42 of file vsync_waiter_ios.mm.

42 {
43 // This way, we will get no more callbacks from the display link that holds a weak (non-nilling)
44 // reference to this C++ object.
45 [client_ invalidate];
46}

Method Documentation

◆ AwaitVSync

- (void) VsyncWaiterIOS:

Implements flutter::VsyncWaiter.

Definition at line 48 of file vsync_waiter_ios.mm.

48 {
49 double new_max_refresh_rate = DisplayLinkManager.displayRefreshRate;
50 if (fabs(new_max_refresh_rate - max_refresh_rate_) > kRefreshRateDiffToIgnore) {
51 max_refresh_rate_ = new_max_refresh_rate;
52 [client_ setMaxRefreshRate:max_refresh_rate_];
53 }
54 [client_ await];
55}
static const double kRefreshRateDiffToIgnore

◆ GetRefreshRate

- (double) VsyncWaiterIOS: const

Implements flutter::VariableRefreshRateReporter.

Definition at line 58 of file vsync_waiter_ios.mm.

58 {
59 return client_.refreshRate;
60}

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