-
Notifications
You must be signed in to change notification settings - Fork 6k
[Multiwindow] Renderers receive view IDs as argument #36593
[Multiwindow] Renderers receive view IDs as argument #36593
Conversation
- (FlutterMetalTexture)createTextureForView:(uint64_t)viewId size:(CGSize)size { | ||
FlutterView* view = [_viewProvider getView:viewId]; | ||
if (view == nil) { | ||
FML_LOG(WARNING) << "Can't create texture on a non-existent view."; |
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.
Should this be an error? When can this happen?
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.
When the caller sends a view ID that the engine does not recognize. When the engine is run as a whole, this should not happen.
(Yes, the same as #36392 (comment) )
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.
If this shouldn't happen, is there any reason not to make it an assertion?
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.
Nope. I've converted it to an assertion.
@@ -406,7 +406,6 @@ - (void)loadAOTData:(NSString*)assetsDir { | |||
- (void)setViewController:(FlutterViewController*)controller { | |||
if (_viewController != controller) { | |||
_viewController = controller; | |||
[_renderer setFlutterView:controller.flutterView]; |
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.
Where is the view registered with the view provider?
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.
Any other places. The view provider is just a protocol/facade over other classes, and will have other methods to register views, which is not shown as a view provider.
In the real application the view provider is macos/FlutterEngine
, which is the source-of-truth of the set of views.
shell/platform/darwin/macos/framework/Source/FlutterMetalRendererTest.mm
Outdated
Show resolved
Hide resolved
fbc4210
to
8e7c29e
Compare
I've fixed all the comments. Thanks for pointing out |
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.
…115592) * ac874d676 [Multiwindow] Renderers receive view IDs as argument (flutter/engine#36593) * bc86c1ff5 Roll Skia from d90917a1da6b to 89f8ba6f749d (10 revisions) (flutter/engine#37723) * dd12a4058 delete fontface polyfill (flutter/engine#37652) * 1e1a4ab3c Add call to Dart_NotifyDestroyed when the flutter view is destroyed. (flutter/engine#37539)
…lutter#115592) * ac874d676 [Multiwindow] Renderers receive view IDs as argument (flutter/engine#36593) * bc86c1ff5 Roll Skia from d90917a1da6b to 89f8ba6f749d (10 revisions) (flutter/engine#37723) * dd12a4058 delete fontface polyfill (flutter/engine#37652) * 1e1a4ab3c Add call to Dart_NotifyDestroyed when the flutter view is destroyed. (flutter/engine#37539)
…lutter#115592) * ac874d676 [Multiwindow] Renderers receive view IDs as argument (flutter/engine#36593) * bc86c1ff5 Roll Skia from d90917a1da6b to 89f8ba6f749d (10 revisions) (flutter/engine#37723) * dd12a4058 delete fontface polyfill (flutter/engine#37652) * 1e1a4ab3c Add call to Dart_NotifyDestroyed when the flutter view is destroyed. (flutter/engine#37539)
This PR changes
FlutterRenderer
so that it can no longer be assigned with a view, but instead the methods receive a view ID as an argument when called.Part of the multiwindow project (design doc): There can only be one renderer, since the renderer is created when the engine is initialized. Therefore, the renderer must be able to handle multiple views.
Pre-launch Checklist
writing and running engine tests.
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.