[Multiwindow] Renderers receive view IDs as argument#36593
[Multiwindow] Renderers receive view IDs as argument#36593auto-submit[bot] merged 22 commits intoflutter:mainfrom
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.
Should this be an error? When can this happen?
There was a problem hiding this comment.
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.
If this shouldn't happen, is there any reason not to make it an assertion?
There was a problem hiding this comment.
Nope. I've converted it to an assertion.
| - (void)setViewController:(FlutterViewController*)controller { | ||
| if (_viewController != controller) { | ||
| _viewController = controller; | ||
| [_renderer setFlutterView:controller.flutterView]; |
There was a problem hiding this comment.
Where is the view registered with the view provider?
There was a problem hiding this comment.
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 |
* ac874d6 [Multiwindow] Renderers receive view IDs as argument (flutter/engine#36593) * bc86c1f Roll Skia from d90917a1da6b to 89f8ba6f749d (10 revisions) (flutter/engine#37723) * dd12a40 delete fontface polyfill (flutter/engine#37652) * 1e1a4ab Add call to Dart_NotifyDestroyed when the flutter view is destroyed. (flutter/engine#37539)
…5592) * ac874d6 [Multiwindow] Renderers receive view IDs as argument (flutter/engine#36593) * bc86c1f Roll Skia from d90917a1da6b to 89f8ba6f749d (10 revisions) (flutter/engine#37723) * dd12a40 delete fontface polyfill (flutter/engine#37652) * 1e1a4ab Add call to Dart_NotifyDestroyed when the flutter view is destroyed. (flutter/engine#37539)
…5592) * ac874d6 [Multiwindow] Renderers receive view IDs as argument (flutter/engine#36593) * bc86c1f Roll Skia from d90917a1da6b to 89f8ba6f749d (10 revisions) (flutter/engine#37723) * dd12a40 delete fontface polyfill (flutter/engine#37652) * 1e1a4ab Add call to Dart_NotifyDestroyed when the flutter view is destroyed. (flutter/engine#37539)

This PR changes
FlutterRendererso 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.