-
Notifications
You must be signed in to change notification settings - Fork 6k
maintain at most single overlay for each view in hybrid composition #25323
maintain at most single overlay for each view in hybrid composition #25323
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
| if (overlay_layers.at(view_id).empty()) { | ||
| overlay_layers.at(view_id).push_back(intersection_rect); | ||
| } else if (intersection_rect.contains( | ||
| overlay_layers.at(view_id).back())) { |
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.
I was expecting the overlay layers to be associated with two different view_ids since there are two platform views, and the fab button intersects both.
Do you mind verifying why a single view_id contain the two overlay surfaces?
|
For testing, we use the scenario app. https://github.com/flutter/engine/blob/master/testing/scenario_app/README.md#running-for-android. The tests are in https://github.com/flutter/engine/blob/master/testing/scenario_app/android/app/src/androidTest/java/dev/flutter/scenariosui/PlatformViewUiTests.java. Thanks for the contribution, and let me know if you encounter any issue. |
|
@blasten I updated bug reproduction example https://github.com/2ZeroSix/flutter_android_surface_activity_destroy_bug_example/tree/multiple_scrollable_overlays I found strange behavior (like a race condition) when view should jump between overlay and background layers To fix this I just added empty fullscreen platform view. videobackground android view is disabled: flutter views in listview might get clipped in region of transition between background and overlay layers master: FILE.2021-04-01.14.25.36.mp4this pr: FILE.2021-04-01.14.33.31.mp4 |
|
Do we understand the issue and/or are we making progress? |
|
@chinmaygarde Hard to say without debugging it. I will take a look shortly. |
|
@blasten Is this still on your plate? Is there someone else we can find to review this patch? |
|
@2ZeroSix I took a closer look, and this seems reasonable. Can you add some unit tests for each of the code branches? |
|
Any updates on the unit-tests? |
|
Thanks for the contribution. I will take this bug, and add the tests. |
Fixed rendering of single widget in multiple overlays on top of each hybrid composition PlatformView
I wasn't able to come up with any meaningful test for this scenario (besides snapshot test on android device), would appreciate any help here.
reproduction examples:
simple case in multiple_overlays branch (from original issue): https://github.com/2ZeroSix/flutter_android_surface_activity_destroy_bug_example/tree/multiple_overlays
screenshots
complex case in multiple_scrollable_overlays branch: https://github.com/2ZeroSix/flutter_android_surface_activity_destroy_bug_example/tree/multiple_scrollable_overlays
videos
before
FILE.2021-03-31.13.00.57.mp4
after
FILE.2021-03-31.13.01.14.mp4
List which issues are fixed by this PR. You must list at least one issue.
fixes flutter/flutter#79371
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.