Add an Info.plist flag to enable MacOS platform views preview support#22929
Add an Info.plist flag to enable MacOS platform views preview support#22929RichardJCai wants to merge 5 commits intoflutter:masterfrom
Conversation
Add platform view support in FlutterGLCompositor and FlutterViewController
80af14c to
b28f61f
Compare
…upport for MacOS. Enabling the key disables smooth resizing.
b28f61f to
b33da83
Compare
cyanglaz
left a comment
There was a problem hiding this comment.
I'm not sure about [FlutterView present] and [FlutterView reshaped]
Maybe @iskakaushik has more context as he reviewed #21525?
cc @knopp
|
|
||
| @implementation FlutterPlatformViewController | ||
| @implementation FlutterPlatformViewController { | ||
| bool _embeddedViewsEnabled; |
There was a problem hiding this comment.
We don't need this instance method.
| // found in the LICENSE file. | ||
|
|
||
| // The name of the Info.plist flag to enable the embedded MacOS views preview. | ||
| const char* const kEmbeddedViewsPreview = "io.flutter_embedded_views_preview"; |
There was a problem hiding this comment.
Don't need the constant in a separate file, can move it to FlutterPlatformViewController.mm
|
|
||
| - (void)registerViewFactory:(nonnull NSObject<FlutterPlatformViewFactory>*)factory | ||
| withId:(nonnull NSString*)factoryId { | ||
| if (!_embeddedViewsEnabled) { |
There was a problem hiding this comment.
Can just be if (![self embeddedViewsEnabled])
| - (void)onCreateWithViewId:(int64_t)viewId | ||
| viewType:(nonnull NSString*)viewType | ||
| result:(nonnull FlutterResult)result { | ||
| if (!_embeddedViewsEnabled) { |
There was a problem hiding this comment.
I don't think we need this, the if (factory == nil) already handles this.
Same in onDispose
| __weak id<FlutterViewReshapeListener> _reshapeListener; | ||
| FlutterResizeSynchronizer* _resizeSynchronizer; | ||
| FlutterSurfaceManager* _surfaceManager; | ||
| bool _embedded_views_preview_enabled; |
There was a problem hiding this comment.
Don't need this ivar, can just use [FlutterPlatformViewController embeddedViewsEnabled] when necessary.
|
First iteration of smooth resizing worked with merged platform / raster threads so it should be possible to do it here as well. I'll look into it when this lands. Might be bit trickier for dynamic thread merging. |
|
@iskakaushik Do you know who the owner for this is? |
I'd be happy to continue working on this one, but waiting on this #22905 to get reviewed. |
Enabling the flag
io.flutter_embedded_views_previewenables platform view support for MacOS.Additionally, when the flag is enabled, the render and main threads are merged, however this disables smooth resizing as smooth resizing requires synchronization and blocking between the main and render thread.
Tentatively using the
io.flutter_embedded_views_previewflag as it was used in #6756.Please only review the last commit, this PR depends on #22905 being merged.