Flutter iOS Embedder
DisplayLinkManager Class Reference

#import <vsync_waiter_ios.h>

Inheritance diagram for DisplayLinkManager:

Class Methods

(double) + displayRefreshRate
 
(double) + displayRefreshRate
 The display refresh rate used for reporting purposes. The engine does not care about this for frame scheduling. It is only used by tools for instrumentation. The engine uses the duration field of the link per frame for frame scheduling. More...
 

Properties

BOOL maxRefreshRateEnabledOnIPhone
 

Detailed Description

Definition at line 12 of file FlutterMetalLayer.mm.

Method Documentation

◆ displayRefreshRate [1/2]

+ (double) displayRefreshRate

Definition at line 160 of file vsync_waiter_ios.mm.

160  {
161  fml::scoped_nsobject<CADisplayLink> display_link = fml::scoped_nsobject<CADisplayLink> {
162  [[CADisplayLink displayLinkWithTarget:[[[DisplayLinkManager alloc] init] autorelease]
163  selector:@selector(onDisplayLink:)] retain]
164  };
165  display_link.get().paused = YES;
166  auto preferredFPS = display_link.get().preferredFramesPerSecond;
167 
168  // From Docs:
169  // The default value for preferredFramesPerSecond is 0. When this value is 0, the preferred
170  // frame rate is equal to the maximum refresh rate of the display, as indicated by the
171  // maximumFramesPerSecond property.
172 
173  if (preferredFPS != 0) {
174  return preferredFPS;
175  }
176 
177  return [UIScreen mainScreen].maximumFramesPerSecond;
178 }

Referenced by VSyncClient::initWithTaskRunner:callback:.

◆ displayRefreshRate [2/2]

+ (double) displayRefreshRate

The display refresh rate used for reporting purposes. The engine does not care about this for frame scheduling. It is only used by tools for instrumentation. The engine uses the duration field of the link per frame for frame scheduling.

Attention
Do not use the this call in frame scheduling. It is only meant for reporting.
Returns
The refresh rate in frames per second.

Property Documentation

◆ maxRefreshRateEnabledOnIPhone

- (BOOL) maxRefreshRateEnabledOnIPhone
readnonatomicassign

Definition at line 13 of file FlutterMetalLayer.mm.

Referenced by VSyncClient::setMaxRefreshRate:.


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