-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Conditionally release image textures (i.e. release platform view textures only) #163692
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
Conditionally release image textures (i.e. release platform view textures only) #163692
Conversation
| manual, | ||
|
|
||
| /** | ||
| * The surface may be reset if the app enters the background. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has to be will and not may, because if the image is cleared and the surface is not reset, we'll get the bug you're trying to fix.
| jlong texture_id, | ||
| jobject image_texture_entry) { | ||
| jobject image_texture_entry, | ||
| jboolean reset_on_gr_context_destroyed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: call this something unrelated to gr_context which is a Skia concept only
| const fml::jni::ScopedJavaGlobalRef<jobject>& image_texture_entry, | ||
| const std::shared_ptr<PlatformViewAndroidJNI>& jni_facade); | ||
| const std::shared_ptr<PlatformViewAndroidJNI>& jni_facade, | ||
| const ImageLifecycle lifecycle = ImageLifecycle::kReset); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and elsewhere I would probably leave this without a default value. its important that we don't ever forget to pass it, as IIRC there is not a safe default: that is, not disposing the image when the surface is an error and disposing the image when the surface is retained leads to a blank screen.
jonahwilliams
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM w/ nits
|
Oh and tests too, naturally :) |
jonahwilliams
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using request changes to indicate I would like changes made
Fixes #163561 Fixes #156488 Fixes #156489 Fixes #163520 Forked from #163692 Only release background image readers on Android 14. I believe reader disposal is the ultimate cause of #162147 , where older android devices don't seem to handle backgrounding the same way we expect on newer devices. The result of this is a crash in HWUI, which is unexpected. Since we only ever did the background release to work around an ANdroid 14 bug, and because it breaks other functionality like background playback - we should remove it for all targets besides 14.
…er#165942) Fixes flutter#163561 Fixes flutter#156488 Fixes flutter#156489 Fixes flutter#163520 Forked from flutter#163692 Only release background image readers on Android 14. I believe reader disposal is the ultimate cause of flutter#162147 , where older android devices don't seem to handle backgrounding the same way we expect on newer devices. The result of this is a crash in HWUI, which is unexpected. Since we only ever did the background release to work around an ANdroid 14 bug, and because it breaks other functionality like background playback - we should remove it for all targets besides 14.
…er#165942) Fixes flutter#163561 Fixes flutter#156488 Fixes flutter#156489 Fixes flutter#163520 Forked from flutter#163692 Only release background image readers on Android 14. I believe reader disposal is the ultimate cause of flutter#162147 , where older android devices don't seem to handle backgrounding the same way we expect on newer devices. The result of this is a crash in HWUI, which is unexpected. Since we only ever did the background release to work around an ANdroid 14 bug, and because it breaks other functionality like background playback - we should remove it for all targets besides 14.
Closes #163561.
If this is the right approach, I'll clean it up a bit and add a few unit tests.