-
Notifications
You must be signed in to change notification settings - Fork 6k
[macos] Enable macOS platform views only for Metal #30853
Conversation
shell/platform/darwin/macos/framework/Source/FlutterViewController_Internal.h
Show resolved
Hide resolved
74338e9 to
00422f0
Compare
Can we do static thread merging (with a info.plist key) for this as a beta version? |
shell/platform/darwin/macos/framework/Headers/FlutterPlatformViews.h
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Headers/FlutterPlatformViews.h
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Headers/FlutterPlatformViews.h
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterMetalCompositor.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterMetalCompositor.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterPlatformViewController.mm
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterPlatformViewController.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterPlatformViewController.h
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterPlatformViewController.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterPlatformViewController.mm
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % nits
shell/platform/darwin/macos/framework/Source/FlutterPlatformViewController.mm
Outdated
Show resolved
Hide resolved
* The plan is to only support platform views when using Metal rendering backend. * This PR is based on the work done in: flutter#22905 * There are some threading issues to be addressed still to make this feature usable: flutter/flutter#96668 * Example is at: https://github.com/iskakaushik/flutter_macos_platform_view_example
| * the Dart code, this will be null. Otherwise this will be the value sent from the Dart code as | ||
| * decoded by `createArgsCodec`. | ||
| */ | ||
| - (nonnull NSView*)createWithviewIdentifier:(int64_t)viewId arguments:(nullable id)args; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
view is incorrectly capitalized. This should be fixed ASAP as it is a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing this at: #30996, I will make a follow up PR for the other issues raised.
| * Only implement this if `createWithFrame` needs an arguments parameter. | ||
| */ | ||
| @optional | ||
| - (nullable NSObject<FlutterMessageCodec>*)createArgsCodec; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ideally shouldn't have "create" in the name; that's not standard naming for a getter. There's no reason this needs to create something every time.
| #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterRenderingBackend.h" | ||
| #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterViewController_Internal.h" | ||
| #include "flutter/shell/platform/embedder/embedder.h" | ||
| #import "flutter/shell/platform/embedder/embedder.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change violates the style guide
| /** | ||
| * Creates a platform view channel and sets up the method handler. | ||
| */ | ||
| - (void)setupPlatformViewChannel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The verb is "set up", so this should be setUpPlatformViewChannel
| object:nil]; | ||
|
|
||
| _platformViewController = [[FlutterPlatformViewController alloc] init]; | ||
| [self setupPlatformViewChannel]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should never call methods on self in init.
partially addresses: flutter/flutter#41722