Flutter Engine
DisplayLinkManager Class Reference

#import <vsync_waiter_ios.h>

Inheritance diagram for DisplayLinkManager:

Instance Methods

(instancetype) - init
 
(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 111 of file vsync_waiter_ios.mm.

References display_link_.

111  {
112  if (@available(iOS 10.3, *)) {
113  auto preferredFPS = display_link_.get().preferredFramesPerSecond; // iOS 10.0
114 
115  // From Docs:
116  // The default value for preferredFramesPerSecond is 0. When this value is 0, the preferred
117  // frame rate is equal to the maximum refresh rate of the display, as indicated by the
118  // maximumFramesPerSecond property.
119 
120  if (preferredFPS != 0) {
121  return preferredFPS;
122  }
123 
124  return [UIScreen mainScreen].maximumFramesPerSecond; // iOS 10.3
125  } else {
126  return 60.0;
127  }
128 }
fml::scoped_nsobject< CADisplayLink > display_link_

◆ init()

- (instancetype) init
Initial value:

Definition at line 98 of file vsync_waiter_ios.mm.

References display_link_.

98  {
99  self = [super init];
100 
101  if (self) {
103  [[CADisplayLink displayLinkWithTarget:self selector:@selector(onDisplayLink:)] retain]
104  };
105  display_link_.get().paused = YES;
106  }
107 
108  return self;
109 }
fml::scoped_nsobject< CADisplayLink > display_link_

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