Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Static Public Member Functions | List of all members
io.flutter.view.VsyncWaiter Class Reference

Classes

class  DisplayListener
 

Public Member Functions

void init ()
 

Static Public Member Functions

static VsyncWaiter getInstance (float fps, @NonNull FlutterJNI flutterJNI)
 
static VsyncWaiter getInstance ( @NonNull DisplayManager displayManager, @NonNull FlutterJNI flutterJNI)
 
static void reset ()
 

Detailed Description

Definition at line 15 of file VsyncWaiter.java.

Member Function Documentation

◆ getInstance() [1/2]

static VsyncWaiter io.flutter.view.VsyncWaiter.getInstance ( @NonNull DisplayManager  displayManager,
@NonNull FlutterJNI  flutterJNI 
)
inlinestatic

Definition at line 61 of file VsyncWaiter.java.

62 {
63 if (instance == null) {
64 instance = new VsyncWaiter(flutterJNI);
65 }
66 if (listener == null) {
67 listener = instance.new DisplayListener(displayManager);
68 listener.register();
69 }
70 if (instance.refreshPeriodNanos == -1) {
71 final Display primaryDisplay = displayManager.getDisplay(Display.DEFAULT_DISPLAY);
72 float fps = primaryDisplay.getRefreshRate();
73 instance.refreshPeriodNanos = (long) (1000000000.0 / fps);
74 flutterJNI.setRefreshRateFPS(fps);
75 }
76 return instance;
77 }
void setRefreshRateFPS(float refreshRateFPS)

◆ getInstance() [2/2]

static VsyncWaiter io.flutter.view.VsyncWaiter.getInstance ( float  fps,
@NonNull FlutterJNI  flutterJNI 
)
inlinestatic

Definition at line 51 of file VsyncWaiter.java.

51 {
52 if (instance == null) {
53 instance = new VsyncWaiter(flutterJNI);
54 }
55 flutterJNI.setRefreshRateFPS(fps);
56 instance.refreshPeriodNanos = (long) (1000000000.0 / fps);
57 return instance;
58 }

◆ init()

void io.flutter.view.VsyncWaiter.init ( )
inline

Definition at line 128 of file VsyncWaiter.java.

128 {
129 flutterJNI.setAsyncWaitForVsyncDelegate(asyncWaitForVsyncDelegate);
130 }
void setAsyncWaitForVsyncDelegate(@Nullable AsyncWaitForVsyncDelegate delegate)

◆ reset()

static void io.flutter.view.VsyncWaiter.reset ( )
inlinestatic

Definition at line 81 of file VsyncWaiter.java.

81 {
82 instance = null;
83 listener = null;
84 }

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