Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@0xZOne
Copy link
Member

@0xZOne 0xZOne commented Aug 24, 2021

Fix issues:
#88558
#88845

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.
  • I signed the CLA.
  • All existing and new tests are passing.

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.

@eggfly
Copy link
Member

eggfly commented Aug 24, 2021

Maybe a solution is not setting flutterImageView and previousRenderSurface to null in detachFromFlutterEngine()?

public void detachFromFlutterEngine() {
    Log.v(TAG, "Detaching from a FlutterEngine: " + flutterEngine);

    // ... 

    // flutterImageView = null;
    // previousRenderSurface = null;
    flutterEngine = null;
}

@0xZOne

@0xZOne
Copy link
Member Author

0xZOne commented Aug 24, 2021

Maybe a solution is not setting flutterImageView and previousRenderSurface to null in detachFromFlutterEngine()?

public void detachFromFlutterEngine() {
    Log.v(TAG, "Detaching from a FlutterEngine: " + flutterEngine);

    // ... 

    // flutterImageView = null;
    // previousRenderSurface = null;
    flutterEngine = null;
}

@0xZOne

We need to revert |renderSurface| to |previousRenderSurface| here to avoid a black screen due to the surface missing when it attaches to the engine again. #88845

0xZOne added a commit to alibaba/flutter_boost that referenced this pull request Aug 25, 2021
@chinmaygarde chinmaygarde requested a review from blasten August 30, 2021 18:25
Copy link

@blasten blasten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good fix. However, can we add a test to FlutterViewTest?

One possible test is:

  1. Make renderSurface visible for testing. (Remove private modifier).
  2. Construct FlutterView
  3. Call convertToImageView()
  4. Verify renderSurface is a FlutterImageView
  5. Call detachFromFlutterEngine()
  6. Verify renderSurface is not a FlutterImageView

@0xZOne
Copy link
Member Author

0xZOne commented Sep 2, 2021

This is a good fix. However, can we add a test to FlutterViewTest?

One possible test is:

  1. Make renderSurface visible for testing. (Remove private modifier).
  2. Construct FlutterView
  3. Call convertToImageView()
  4. Verify renderSurface is a FlutterImageView
  5. Call detachFromFlutterEngine()
  6. Verify renderSurface is not a FlutterImageView

done.

@0xZOne 0xZOne requested a review from blasten September 2, 2021 07:46
@0xZOne 0xZOne changed the title [shared engine][android] The platform view using hybrid composition i… [android] Fix black and blank screen issues on the platform view page. Sep 2, 2021
@0xZOne
Copy link
Member Author

0xZOne commented Sep 10, 2021

Those tests seem interrupted by user for some reason. Can anyone help rebuild, please? thanks.

@ColdPaleLight
Copy link
Member

Those tests seem interrupted by user for some reason. Can anyone help rebuild, please? thanks.

Done

@0xZOne
Copy link
Member Author

0xZOne commented Sep 11, 2021

Linux Framework Smoke Tests failure is unrelated to my changes. See #28535 for details.

@chinmaygarde
Copy link
Member

This patch needs to be rebased on ToT for the presubmits to run again please? And CC @blasten for the re-review.

Copy link

@blasten blasten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - nicely done

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants