This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Don't depend on an implicit transaction when presenting drawables on the raster thread.#18076
Merged
chinmaygarde merged 1 commit intoflutter:masterfrom May 1, 2020
Merged
Conversation
…the raster thread. The way transactions were added changed in flutter@68fd833. This broke rendering using both Metal and OpenGL when no implicit transaction was present on the transaction stack. The failure models differ based on Metal vs. OpenGL and iOS/device versions. On older versions of iOS, rendering would consume memory till exhaustion. On newer iOS versions, rendering would be stuck (till a timeout). This patch brings transaction management back in line with as it was earlier and also makes the Metal backend resilient to transactions being present on the transaction stack at all. Since this is still quite brittle, transaction management must be moved to IOSSurface as a followup. Fixes flutter/flutter#55784.
chinmaygarde
commented
May 1, 2020
| // When there are platform views in the scene, the drawable needs to be presented in the same | ||
| // transaction as the one created for platform views. When the drawable are being presented from | ||
| // the raster thread, there is no such transaction. | ||
| layer_.get().presentsWithTransaction = [[NSThread currentThread] isMainThread]; |
Contributor
Author
There was a problem hiding this comment.
Ideally, I would do the same thing in gpu_surace_gl but that does not have access to the layer as it is platform agnostic. The right fix for this is to add a method to the surface delegate that sets the layer property on iOS.
Contributor
|
Shall we add a memory test to our devicelab that plays a video for a while to guard future regressions like flutter/flutter#55784 ? CC @dnfield |
Contributor
Author
That is necessary but not currently sufficient because the memory issue only manifest on iPhone 6. On newer iPhones, there is stutter till the presentation times out. |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 1, 2020
…bles on the raster thread. (flutter/engine#18076)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 1, 2020
…bles on the raster thread. (flutter/engine#18076)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 2, 2020
…bles on the raster thread. (flutter/engine#18076)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 5, 2020
…bles on the raster thread. (flutter/engine#18076)
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

The way transactions were added changed in
68fd833.
This broke rendering using both Metal and OpenGL when no implicit transaction
was present on the transaction stack. The failure models differ based on Metal
vs. OpenGL and iOS/device versions. On older versions of iOS, rendering would
consume memory till exhaustion. On newer iOS versions, rendering would be stuck
(till a timeout). This patch brings transaction management back in line with as
it was earlier and also makes the Metal backend resilient to transactions being
present on the transaction stack at all. Since this is still quite brittle,
transaction management must be moved to IOSSurface as a followup.
Fixes flutter/flutter#55784.