Skip to content
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

Prevent race condition while switching surfaces #24838

Merged
merged 1 commit into from
Mar 6, 2021

Conversation

blasten
Copy link

@blasten blasten commented Mar 6, 2021

Reworks #24363 to address the real root cause, and fix https://b.corp.google.com/issues/181010760.

When a platform view widget is rebuilt, the previous platform view is disposed, and a new one is initialized.
However, a frame is pushed in the middle of this operation that does not contain a platform view layer in the
layer tree as it can be seen here.

This causes the Flutter surface to change back and forth (from FlutterImageView to FlutterSurfaceView to FlutterImageView).
During this process, we currently insert a listener that waits for the first frame in the FlutterSurfaceView's buffer before completely dropping FlutterImageView. However, by that time, the new FlutterImageView buffer is used.
As a result, the UI is stuck as it assumed that FlutterSurfaceView is rendering Flutter pixels, but it isn't.

Tests: This change will be tested in the framework - I'd like to have an e2e test for this change.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.
  • The reviewer has submitted any presubmit flakes in this PR using the engine presubmit flakes form before re-triggering the failure.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

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.

@blasten blasten merged commit 9662a38 into flutter:master Mar 6, 2021
@blasten blasten deleted the relad_key_support branch March 6, 2021 05:50
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 6, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 6, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 6, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 6, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 6, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 7, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 7, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 7, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 7, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 7, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 7, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 7, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 8, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 8, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 8, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 8, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 8, 2021
zanderso pushed a commit to flutter/flutter that referenced this pull request Mar 8, 2021
* 968e69d vulkan: Fix build issue due to missing VK_RESULT_RANGE_SIZE (flutter/engine#24829)

* d9fdce4 Roll Skia from 3dc6c190dabb to 9ef3f2e3da9f (9 revisions) (flutter/engine#24830)

* 510d2ab [web] Fix url updates when using Router (flutter/engine#24798)

* fee85ab [web] Don't set both color and foreground at the same time (flutter/engine#24828)

* 45ff1a2 Roll Fuchsia Mac SDK from Ks1dVR_ST... to PPdB-GHCt... (flutter/engine#24832)

* 81e219e Roll Fuchsia Linux SDK from zPlM6iYY3... to Suchs2RGt... (flutter/engine#24834)

* c49b2fa Roll Skia from 9ef3f2e3da9f to 8f440b4e1e22 (2 revisions) (flutter/engine#24835)

* ce21b84 Roll Dart SDK from 4693d6d4f88e to b77641194368 (3 revisions) (flutter/engine#24836)

* 9662a38 Prevent race condition while switching surfaces (flutter/engine#24838)

* 805a93c Roll Dart SDK from b77641194368 to fee865ec6404 (1 revision) (flutter/engine#24839)

* 0a2ffe4 Roll Fuchsia Mac SDK from PPdB-GHCt... to Xkten1Nxc... (flutter/engine#24841)

* 8c8eafd Roll Fuchsia Linux SDK from Suchs2RGt... to 4_MXZyYYE... (flutter/engine#24842)

* 09b2468 Roll Skia from 8f440b4e1e22 to 00d6cf436884 (1 revision) (flutter/engine#24843)

* f4b2244 Roll Dart SDK from fee865ec6404 to 9bc9e48fe908 (2 revisions) (flutter/engine#24844)

* ac795b8 Roll Dart SDK from 9bc9e48fe908 to b191fb71063c (1 revision) (flutter/engine#24847)

* 55bb5c9 Roll Fuchsia Mac SDK from Xkten1Nxc... to Ler-DhxPF... (flutter/engine#24849)

* 4f49758 Roll Fuchsia Linux SDK from 4_MXZyYYE... to -kU3jhhRL... (flutter/engine#24850)

* 6450de9 Roll Skia from 00d6cf436884 to 1314913ff569 (1 revision) (flutter/engine#24851)

* 6c4b145 Roll Skia from 1314913ff569 to 5f2932e0e391 (1 revision) (flutter/engine#24852)

* 0f6f52b Roll Fuchsia Mac SDK from Ler-DhxPF... to Rw36pWO5J... (flutter/engine#24853)

* 122c99d Roll Fuchsia Linux SDK from -kU3jhhRL... to hnDJ6SZhJ... (flutter/engine#24855)

* 286f20a Roll Skia from 5f2932e0e391 to 07ee548d5bcd (1 revision) (flutter/engine#24856)

* 3b625f5 Roll Dart SDK from b191fb71063c to 64a5583ffbc9 (2 revisions) (flutter/engine#24860)

* 5bb3725 Roll Fuchsia Mac SDK from Rw36pWO5J... to C8RDwF3IB... (flutter/engine#24862)

* 49c1b7d Roll Fuchsia Linux SDK from hnDJ6SZhJ... to yDVPrfGq5... (flutter/engine#24863)

* 6602df4 Revert "[web] Fix url updates when using Router (#24798)" (flutter/engine#24870)
hjfreyer pushed a commit to hjfreyer/engine that referenced this pull request Mar 22, 2021
chriscraws pushed a commit to chriscraws/engine that referenced this pull request Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants