Flutter Engine
DisplayLinkManager Class Reference

#import <vsync_waiter_ios.h>

Inheritance diagram for DisplayLinkManager:

Class Methods

(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...
 

Detailed Description

Definition at line 13 of file vsync_waiter_ios.h.

Method Documentation

◆ 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.

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

Definition at line 110 of file vsync_waiter_ios.mm.

References fml::scoped_nsprotocol< NST *>::get().

Referenced by FlutterEngine::destroyContext.

110  {
111  if (@available(iOS 10.3, *)) {
113  [[CADisplayLink displayLinkWithTarget:[[[DisplayLinkManager alloc] init] autorelease]
114  selector:@selector(onDisplayLink:)] retain]
115  };
116  display_link.get().paused = YES;
117  auto preferredFPS = display_link.get().preferredFramesPerSecond; // iOS 10.0
118 
119  // From Docs:
120  // The default value for preferredFramesPerSecond is 0. When this value is 0, the preferred
121  // frame rate is equal to the maximum refresh rate of the display, as indicated by the
122  // maximumFramesPerSecond property.
123 
124  if (preferredFPS != 0) {
125  return preferredFPS;
126  }
127 
128  return [UIScreen mainScreen].maximumFramesPerSecond; // iOS 10.3
129  } else {
130  return 60.0;
131  }
132 }

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