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

Request another frame in ImageReaderSurfaceProducer.dequeueImage if more images are pending in the queue #55944

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

jason-simmons
Copy link
Member

ImageReaderSurfaceProducer will request a frame when an image is enqueued. But there is no guarantee that each request will produce an additional frame.
Multiple requests happening within one vsync interval could be merged into one frame. If no other frame is scheduled, then some images will remain in the queue and the image shown on screen will not be the latest image.

With this change, ImageReaderSurfaceProducer will continue requesting frames after consuming an image if the queue is not empty.

Fixes flutter/flutter#156903
Fixes flutter/flutter#155787

…ore images are pending in the queue

ImageReaderSurfaceProducer will request a frame when an image is enqueued.
But there is no guarantee that each request will produce an additional frame.
Multiple requests happening within one vsync interval could be merged into
one frame.  If no other frame is scheduled, then some images will remain in
the queue and the image shown on screen will not be the latest image.

With this change, ImageReaderSurfaceProducer will continue requesting frames
after consuming an image if the queue is not empty.

Fixes flutter/flutter#156903
Fixes flutter/flutter#155787
Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

Thank you for tracking this down. I think this is a reasonable way to do FIFO. If we wanted to switch to a mailbox style we can always change it in the future.

@jason-simmons jason-simmons added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 21, 2024
@auto-submit auto-submit bot merged commit 1a8ef6e into flutter:main Oct 21, 2024
31 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 21, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 21, 2024
…157277)

flutter/engine@68f9225...1a8ef6e

2024-10-21 [email protected] Request another frame in ImageReaderSurfaceProducer.dequeueImage if more images are pending in the queue (flutter/engine#55944)
2024-10-21 [email protected] Roll Dart SDK from c8659684d34d to 10387c3fc6d4 (1 revision) (flutter/engine#55987)
2024-10-21 [email protected] [web] Support woff2 fonts (flutter/engine#55908)
2024-10-21 [email protected] Roll Fuchsia Linux SDK from PWz1ufnYNOGpgw-qg... to avSAUwQTf5xVGuZQU... (flutter/engine#55985)
2024-10-21 [email protected] Manual roll Dart SDK from a51df90298ca to c8659684d34d (4 revisions) (flutter/engine#55984)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from PWz1ufnYNOGp to avSAUwQTf5xV

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] 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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 21, 2024
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
…ore images are pending in the queue (flutter/engine#55944)

ImageReaderSurfaceProducer will request a frame when an image is enqueued. But there is no guarantee that each request will produce an additional frame.
Multiple requests happening within one vsync interval could be merged into one frame.  If no other frame is scheduled, then some images will remain in the queue and the image shown on screen will not be the latest image.

With this change, ImageReaderSurfaceProducer will continue requesting frames after consuming an image if the queue is not empty.

Fixes flutter#156903
Fixes flutter#155787
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 platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linux_android_emu_34 flutter_driver_android_test is flaky Android platform views sometimes render previously drawn content after a screen rotation
2 participants