Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Instance Methods | List of all members
flutter::VsyncWaiterIOS Class Referencefinal

#include <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
 
 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 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 27 of file vsync_waiter_ios.mm.

28 : VsyncWaiter(task_runners) {
29 auto callback = [this](std::unique_ptr<flutter::FrameTimingsRecorder> recorder) {
30 const fml::TimePoint start_time = recorder->GetVsyncStartTime();
31 const fml::TimePoint target_time = recorder->GetVsyncTargetTime();
32 FireCallback(start_time, target_time, true);
33 };
34 client_ = [[VSyncClient alloc] initWithTaskRunner:task_runners_.GetUITaskRunner()
35 callback:callback];
36 max_refresh_rate_ = DisplayLinkManager.displayRefreshRate;
37}
VsyncWaiter(const TaskRunners &task_runners)
void FireCallback(fml::TimePoint frame_start_time, fml::TimePoint frame_target_time, bool pause_secondary_tasks=true)
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 39 of file vsync_waiter_ios.mm.

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

Method Documentation

◆ AwaitVSync

- (void) VsyncWaiterIOS:

Implements flutter::VsyncWaiter.

Definition at line 45 of file vsync_waiter_ios.mm.

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

◆ GetRefreshRate

- (double) VsyncWaiterIOS: const

Implements flutter::VariableRefreshRateReporter.

Definition at line 55 of file vsync_waiter_ios.mm.

55 {
56 return client_.refreshRate;
57}

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