This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] [Android] Refactor the Android context/surface implementation to work more like Skia. #41059
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Makes the impeller::Context available to the rasterizer ASAP, so that even if it has not received a surface yet calls to `toImage` and `toImageSync` can still produce a texture.
Contributor
Author
|
(Looking into the test failure) |
Contributor
Author
|
I'm going to wire up an Impeller variant of |
Member
|
I'm seeing errors at startup when I try to run a demo of multiple engines created from a |
Contributor
Author
|
I've updated the test to use the Metal backend. The GL backend has an additional complication, which I described in flutter/flutter#124635. We should fix that separately IMHO. |
Contributor
Author
d570bbb fixes that locally for me. |
Contributor
Author
|
From triage: I'm going to make a smaller version of this patch that doesn't touch Android as much yet. |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 12, 2023
…mplementation to work more like Skia. (flutter/engine#41059)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 12, 2023
…mplementation to work more like Skia. (flutter/engine#41059)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 12, 2023
…mplementation to work more like Skia. (flutter/engine#41059)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 12, 2023
…mplementation to work more like Skia. (flutter/engine#41059)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 12, 2023
…mplementation to work more like Skia. (flutter/engine#41059)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 12, 2023
…mplementation to work more like Skia. (flutter/engine#41059)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 12, 2023
…mplementation to work more like Skia. (flutter/engine#41059)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 12, 2023
…mplementation to work more like Skia. (flutter/engine#41059)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 12, 2023
…mplementation to work more like Skia. (flutter/engine#41059)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 12, 2023
…mplementation to work more like Skia. (flutter/engine#41059)
zanderso
pushed a commit
to flutter/flutter
that referenced
this pull request
May 12, 2023
…126714) flutter/engine@c784d6d...502e1eb 2023-05-12 [email protected] [Impeller] starts running vulkan golden image tests with swiftshader (flutter/engine#41958) 2023-05-12 [email protected] [web] Fix crash on old versions of Chrome (Intl.Segmenter missing) (flutter/engine#41986) 2023-05-12 [email protected] Move clang tidy v2 build to prod. (flutter/engine#41985) 2023-05-12 [email protected] Reland "Move linux_license to engine v2."" (flutter/engine#41983) 2023-05-12 [email protected] Roll Dart SDK from 6cd6e54f280d to 858f83d6d993 (2 revisions) (flutter/engine#41980) 2023-05-12 [email protected] Roll Skia from 0b929ada9cc6 to 539fb10d7cfb (2 revisions) (flutter/engine#41979) 2023-05-12 [email protected] Roll Fuchsia Mac SDK from MjcKzcsqMDkuRKopu... to rO5qs4MpN6WfJcu64... (flutter/engine#41975) 2023-05-12 [email protected] Roll Dart SDK from 4028c7d8b87c to 6cd6e54f280d (1 revision) (flutter/engine#41974) 2023-05-12 [email protected] Roll Fuchsia Linux SDK from lf8VcONMWlne4oa3H... to HMLNsG7w9sTDpW2Ge... (flutter/engine#41973) 2023-05-12 [email protected] Roll Skia from 208a07f71701 to 0b929ada9cc6 (2 revisions) (flutter/engine#41971) 2023-05-12 [email protected] [Impeller] [Android] Refactor the Android context/surface implementation to work more like Skia. (flutter/engine#41059) 2023-05-12 [email protected] Roll Skia from ccec5093ca38 to 208a07f71701 (1 revision) (flutter/engine#41970) 2023-05-12 [email protected] [Impeller] Dont synthesize fake index buffer if none was provided to VBB (flutter/engine#41969) 2023-05-12 [email protected] [Impeller] Make index buffer optional (flutter/engine#41962) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from lf8VcONMWlne to HMLNsG7w9sTD fuchsia/sdk/core/mac-amd64 from MjcKzcsqMDku to rO5qs4MpN6Wf 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
CaseyHillers
pushed a commit
to CaseyHillers/flutter
that referenced
this pull request
May 24, 2023
…lutter#126714) flutter/engine@c784d6d...502e1eb 2023-05-12 [email protected] [Impeller] starts running vulkan golden image tests with swiftshader (flutter/engine#41958) 2023-05-12 [email protected] [web] Fix crash on old versions of Chrome (Intl.Segmenter missing) (flutter/engine#41986) 2023-05-12 [email protected] Move clang tidy v2 build to prod. (flutter/engine#41985) 2023-05-12 [email protected] Reland "Move linux_license to engine v2."" (flutter/engine#41983) 2023-05-12 [email protected] Roll Dart SDK from 6cd6e54f280d to 858f83d6d993 (2 revisions) (flutter/engine#41980) 2023-05-12 [email protected] Roll Skia from 0b929ada9cc6 to 539fb10d7cfb (2 revisions) (flutter/engine#41979) 2023-05-12 [email protected] Roll Fuchsia Mac SDK from MjcKzcsqMDkuRKopu... to rO5qs4MpN6WfJcu64... (flutter/engine#41975) 2023-05-12 [email protected] Roll Dart SDK from 4028c7d8b87c to 6cd6e54f280d (1 revision) (flutter/engine#41974) 2023-05-12 [email protected] Roll Fuchsia Linux SDK from lf8VcONMWlne4oa3H... to HMLNsG7w9sTDpW2Ge... (flutter/engine#41973) 2023-05-12 [email protected] Roll Skia from 208a07f71701 to 0b929ada9cc6 (2 revisions) (flutter/engine#41971) 2023-05-12 [email protected] [Impeller] [Android] Refactor the Android context/surface implementation to work more like Skia. (flutter/engine#41059) 2023-05-12 [email protected] Roll Skia from ccec5093ca38 to 208a07f71701 (1 revision) (flutter/engine#41970) 2023-05-12 [email protected] [Impeller] Dont synthesize fake index buffer if none was provided to VBB (flutter/engine#41969) 2023-05-12 [email protected] [Impeller] Make index buffer optional (flutter/engine#41962) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from lf8VcONMWlne to HMLNsG7w9sTD fuchsia/sdk/core/mac-amd64 from MjcKzcsqMDku to rO5qs4MpN6Wf 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
jason-simmons
added a commit
to jason-simmons/flutter_engine
that referenced
this pull request
Jul 31, 2023
…and its swapchain In flutter#41059 the Android context and surface were changed to share one impeller::ContextVK across all instances of AndroidSurfaceVulkanImpeller. However, the ContextVK holds a reference to the current swapchain. If an app uses multiple AndroidSurfaceVulkanImpeller instances (e.g. for platform views), then one surface may overwrite the ContextVK's swapchain while another surface is trying to render. This patch allows each surface to get its own impeller::Context instance holding a swapchain tied to that surface. The per-surface contexts will delegate most operations to the shared parent ContextVK.
jason-simmons
added a commit
to jason-simmons/flutter_engine
that referenced
this pull request
Jul 31, 2023
…and its swapchain In flutter#41059 the Android context and surface were changed to share one impeller::ContextVK across all instances of AndroidSurfaceVulkanImpeller. However, the ContextVK holds a reference to the current swapchain. If an app uses multiple AndroidSurfaceVulkanImpeller instances (e.g. for platform views), then one surface may overwrite the ContextVK's swapchain while another surface is trying to render. This patch allows each surface to get its own impeller::Context instance holding a swapchain tied to that surface. The per-surface contexts will delegate most operations to the shared parent ContextVK.
auto-submit bot
pushed a commit
that referenced
this pull request
Jul 31, 2023
…and its swapchain (#44171) In #41059 the Android context and surface were changed to share one impeller::ContextVK across all instances of AndroidSurfaceVulkanImpeller. However, the ContextVK holds a reference to the current swapchain. If an app uses multiple AndroidSurfaceVulkanImpeller instances (e.g. for platform views), then one surface may overwrite the ContextVK's swapchain while another surface is trying to render. This patch allows each surface to get its own impeller::Context instance holding a swapchain tied to that surface. The per-surface contexts will delegate most operations to the shared parent ContextVK.
gaaclarke
pushed a commit
to gaaclarke/engine
that referenced
this pull request
Aug 30, 2023
…and its swapchain (flutter#44171) In flutter#41059 the Android context and surface were changed to share one impeller::ContextVK across all instances of AndroidSurfaceVulkanImpeller. However, the ContextVK holds a reference to the current swapchain. If an app uses multiple AndroidSurfaceVulkanImpeller instances (e.g. for platform views), then one surface may overwrite the ContextVK's swapchain while another surface is trying to render. This patch allows each surface to get its own impeller::Context instance holding a swapchain tied to that surface. The per-surface contexts will delegate most operations to the shared parent ContextVK.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Noticed this while working on flutter/flutter#124181
In Impeller right now, Android creates a context for each surface - but in Skia, Android creates one context and shares it across surfaces. For the multiple-engine scenario this matters. This also makes it possible for Android to provide the impeller::Context independently of surface creation.