-
Notifications
You must be signed in to change notification settings - Fork 6k
Switch to FlutterSurfaceView if no Android view is in the frame #19487
Conversation
// Skip a frame if the embedding is switching surfaces. | ||
auto should_submit_current_frame = | ||
previous_frame_view_count_ > 0 || current_frame_view_count == 0; | ||
if (should_submit_current_frame) { |
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 is false
, when the Java side is switching from FlutterSurfaceView
to FlutterImageView
.
// this becomes true if all the required surfaces have images available. | ||
// | ||
// This is used to decide if the platform views can be rendered in the current frame. | ||
// If one of the surfaces don't have an image, the frame may be incomplete and must be dropped. |
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.
typo: "doesn't"
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.
Done.
// Show platform views only if the surfaces have images available in this frame, | ||
// and if the platform view is rendered in this frame. | ||
// | ||
// Otherwise, hide the platform view, but don't remove it from view hierarchy yet as |
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.
typo: "the view hierarchy"
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.
Done.
Linux Web Engine is failing on
That appears to be fixed upstream. |
Description
This is the last part to address flutter/flutter#58291. When an Android view is present in the frame, we switch the surface from
FlutterSurfaceView
toFlutterImageView
. When no Android view is present, then we switch back to previous surface.cc @jason-simmons
Related Issues
Fixes flutter/flutter#58291
Tests
I added the following tests: Unit tests (WIP)
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.Breaking Change
Did any tests fail when you ran them? Please read handling breaking changes.