-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[macos] Enable macOS platform views only for Metal #30853
Conversation
shell/platform/darwin/macos/framework/Source/FlutterViewController_Internal.h
Outdated
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
Outdated
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
@@ -219,6 +238,9 @@ - (instancetype)initWithName:(NSString*)labelPrefix | |||
name:NSCurrentLocaleDidChangeNotification | |||
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