Flutter Engine
The Flutter Engine
FlutterDisplayLink.h
Go to the documentation of this file.
1#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERDISPLAYLINK_H_
2#define FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERDISPLAYLINK_H_
3
4#import <AppKit/AppKit.h>
5
6@protocol FlutterDisplayLinkDelegate <NSObject>
7- (void)onDisplayLink:(CFTimeInterval)timestamp targetTimestamp:(CFTimeInterval)targetTimestamp;
8@end
9
10/// Provides notifications of display refresh.
11///
12/// Internally FlutterDisplayLink will use at most one CVDisplayLink per
13/// screen shared for all views belonging to that screen. This is necessary
14/// because each CVDisplayLink comes with its own thread.
15@interface FlutterDisplayLink : NSObject
16
17/// Creates new instance tied to provided NSView. FlutterDisplayLink
18/// will track view display changes transparently to synchronize
19/// update with display refresh.
20/// This function must be called on the main thread.
21+ (instancetype)displayLinkWithView:(NSView*)view;
22
23/// Delegate must be set on main thread. Delegate method will be called on
24/// on display link thread.
25@property(nonatomic, weak) id<FlutterDisplayLinkDelegate> delegate;
26
27/// Pauses and resumes the display link. May be called from any thread.
28@property(readwrite) BOOL paused;
29
30/// Returns the nominal refresh period of the display to which the view
31/// currently belongs (in seconds). If view does not belong to any display,
32/// returns 0. Can be called from any thread.
33@property(readonly) CFTimeInterval nominalOutputRefreshPeriod;
34
35/// Invalidates the display link. Must be called on the main thread.
36- (void)invalidate;
37
38@end
39
40#endif // FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERDISPLAYLINK_H_
int BOOL
Definition: windows_types.h:37