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

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Aug 20, 2023

Fixes flutter/flutter#131730

When the Android embedder starts rendering into a FlutterImageView, notify the Impeller context to block on submitKHR.

@chinmaygarde chinmaygarde changed the title [Impeller] sync presentation when rendering into FlutterImageView. [Impeller] Sync presentation when rendering into FlutterImageView. Aug 21, 2023
@jonahwilliams jonahwilliams marked this pull request as ready for review August 21, 2023 18:46
@jonahwilliams
Copy link
Contributor Author

This isn't really the "right" way to do this, but I'm not sure how much effort we should invest in the right way.

I think the correct way would be something like having the FlutterEngine render into an external memory hardware buffer?

return platform_message_handler_;
}

void SetIsRenderingToImageView(bool value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If it is possible (I think it is) to have more than one FlutterImageViews active concurrently this should probably keep track of an integer count and only update the context when it hits 0 or != 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I could get that to happen if I overlay something on the platform view. Will try that out and see if I can repro.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I played aroud with this a bit and I wasn't able to get this to happen in a simple example with an overlay over a platform view. In that case it looks like the overlay view is added as a child of the FlutterView and so their lifecycle is tied.

Perhaps this could happen in an add2app scenario with multiple flutter views sharing the same engine? Extermely cursed to think about those having platform views in them - but I'll make it a count anyway since that should be perfectly safe (TM).

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

@jonahwilliams
Copy link
Contributor Author

I moved the state tracking into the FlutterImageView as there seemed to be fewer potential entrypoints to worry about. Something odd about this style of platform view is that we seem to immediately switch to imageview rendering when the platform view is added to the framework layer tree, even if it is offscreen.

@jonahwilliams
Copy link
Contributor Author

Which is to say this change unfortunately regresses the performance of the entire wonderous editorial screen.

return platform_message_handler_;
}

void SetIsRenderingToImageView(bool value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 28, 2023
@auto-submit auto-submit bot merged commit 1e82196 into flutter:main Aug 29, 2023
@jonahwilliams jonahwilliams deleted the sync_present branch August 29, 2023 00:09
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 29, 2023
fluttermirroringbot pushed a commit to flutter/flutter that referenced this pull request Aug 29, 2023
…133520)

flutter/engine@45e2b41...1e82196

2023-08-29 [email protected] [Impeller] Sync presentation when rendering into FlutterImageView. (flutter/engine#44881)
2023-08-28 [email protected] Roll Fuchsia Linux SDK from AQZddYgKiWrQL8vny... to Ys38QMyFZToJxnXrF... (flutter/engine#45195)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from AQZddYgKiWrQ to Ys38QMyFZToJ

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
gaaclarke pushed a commit to gaaclarke/engine that referenced this pull request Aug 30, 2023
…lutter#44881)

Fixes flutter/flutter#131730

When the Android embedder starts rendering into a FlutterImageView, notify the Impeller context to block on submitKHR.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App e: impeller platform-android

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

[Impeller] Hybrid composition requires synchronous presentation in Vulkan backend.

2 participants