| Flutter iOS Embedder |

Instance Methods | List of all members
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 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 }

References DisplayLinkManager::displayRefreshRate.

## ◆ ~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 }

References VSyncClient::invalidate.

## Method Documentation

## ◆ AwaitVSync

- (void) VsyncWaiterIOS: |  |  |

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 }

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

## ◆ GetRefreshRate

- (double) VsyncWaiterIOS: |  |  | const

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:

- shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h
- shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm

kRefreshRateDiffToIgnore
const static double kRefreshRateDiffToIgnore
Definition: vsync_waiter_ios.mm:26
DisplayLinkManager
Definition: FlutterMetalLayer.mm:16
DisplayLinkManager::displayRefreshRate
double displayRefreshRate
The display refresh rate used for reporting purposes. The engine does not care about this for frame s...
Definition: vsync_waiter_ios.h:32
VSyncClient
Definition: vsync_waiter_ios.h:36