Flutter macOS Embedder
FlutterResizeSynchronizer.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERRESIZESYNCHRONIZER_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERRESIZESYNCHRONIZER_H_
7 
8 #import <Cocoa/Cocoa.h>
9 
12 
13 /**
14  * Class responsible for coordinating window resize with content update.
15  */
16 @interface FlutterResizeSynchronizer : NSObject
17 
18 /**
19  * Begins a resize operation for the given size. Block the thread until
20  * performCommitForSize: with the same size is called.
21  * While the thread is blocked Flutter messages are being pumped.
22  * See [FlutterRunLoop pollFlutterMessagesOnce].
23  */
24 - (void)beginResizeForSize:(CGSize)size notify:(nonnull dispatch_block_t)notify;
25 
26 /**
27  * Called from raster thread. Schedules the given block on platform thread
28  * at given delay and unblocks the platform thread if waiting for the surface
29  * during resize.
30  */
31 - (void)performCommitForSize:(CGSize)size
32  notify:(nonnull dispatch_block_t)notify
33  delay:(NSTimeInterval)delay;
34 
35 /**
36  * Called when the view is shut down. Unblocks platform thread if blocked
37  * during resize.
38  */
39 - (void)shutDown;
40 
41 @end
42 
43 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERRESIZESYNCHRONIZER_H_