Flutter macOS Embedder
FlutterVSyncWaiter.h
Go to the documentation of this file.
1 #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERVSYNCWAITER_H_
2 #define FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERVSYNCWAITER_H_
3 
4 #import <AppKit/AppKit.h>
5 
6 @class FlutterDisplayLink;
7 
8 @interface FlutterVSyncWaiter : NSObject
9 
10 /// Creates new waiter instance tied to provided NSView.
11 /// This function must be called on the main thread.
12 ///
13 /// Provided |block| will be invoked on main thread.
14 - (instancetype)initWithDisplayLink:(FlutterDisplayLink*)displayLink
15  block:(void (^)(CFTimeInterval timestamp,
16  CFTimeInterval targetTimestamp,
17  uintptr_t baton))block;
18 
19 /// Schedules |baton| to be signaled on next display refresh.
20 /// This function must be called on the main thread.
21 - (void)waitForVSync:(uintptr_t)baton;
22 
23 @end
24 
25 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERVSYNCWAITER_H_