Flutter iOS Embedder
flutter::VsyncWaiterIOS Class Referencefinal

#import <vsync_waiter_ios.h>

Inheritance diagram for flutter::VsyncWaiterIOS:

Instance Methods

() - VsyncWaiterIOS
 
() - ~VsyncWaiterIOS
 
(double) - GetRefreshRate
 
(void) - AwaitVSync
 

Detailed Description

Definition at line 77 of file vsync_waiter_ios.h.

Constructor & Destructor Documentation

◆ VsyncWaiterIOS

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

Definition at line 32 of file vsync_waiter_ios.mm.

33  : VsyncWaiter(task_runners) {
34  auto callback = [this](std::unique_ptr<flutter::FrameTimingsRecorder> recorder) {
35  const fml::TimePoint start_time = recorder->GetVsyncStartTime();
36  const fml::TimePoint target_time = recorder->GetVsyncTargetTime();
37  FireCallback(start_time, target_time, true);
38  };
39  client_ = [[VSyncClient alloc] initWithTaskRunner:task_runners_.GetUITaskRunner()
40  callback:callback];
41  max_refresh_rate_ = DisplayLinkManager.displayRefreshRate;
42 }

References DisplayLinkManager::displayRefreshRate.

◆ ~VsyncWaiterIOS

- VsyncWaiterIOS:

Definition at line 44 of file vsync_waiter_ios.mm.

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

References VSyncClient::invalidate.

Method Documentation

◆ AwaitVSync

- (void) VsyncWaiterIOS:

Definition at line 50 of file vsync_waiter_ios.mm.

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

References VSyncClient::await, DisplayLinkManager::displayRefreshRate, kRefreshRateDiffToIgnore, and VSyncClient::setMaxRefreshRate:.

◆ GetRefreshRate

- (double) VsyncWaiterIOS: const

Definition at line 60 of file vsync_waiter_ios.mm.

60  {
61  return client_.refreshRate;
62 }

The documentation for this class was generated from the following files:
kRefreshRateDiffToIgnore
const static double kRefreshRateDiffToIgnore
Definition: vsync_waiter_ios.mm:28
VSyncClient
Definition: vsync_waiter_ios.h:47