-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Wire decodedCacheRatioCap from ImageCache to Codec #22452
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
Conversation
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: remove this blank line
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.
you dropped the await on this one
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.
you could add a test that the various image providers end up calling into the binding (rather than calling dart:ui directly) by creating your own subclass of the binding in the test. there should be some existing tests you can crib from that do similar things.
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.
(or if you put the method on the image cache, you just need to override the image cache)
Provide a relative, per-image limit to the amount of memory that's used to cache decoded image frames. Adds an overridable default that developers can set to control how much memory images are allowed to use decoded vs undecoded. The cap is set in flutter/flutter#22452. Note that required frames are always cached regardless of the ratio cap, because they're currently necessary for the GIF to animate. Previously cached unessential frames are not cleared in response to the cache hitting or exceeding the cap. Addresses #20998 and #14344.
Users can set `ImageCache.decodedCacheRatioCap` to control the max amount of memory used per image to avoid decoding frames each animation loop. This depends on flutter/engine#6310.
|
This is ready to merge now, the engine dependency has been rolled into the framework. |
Users can set
ImageCache.decodedCacheRatioCapto control the maxamount of memory used per image to avoid decoding frames each animation
loop.
This depends on flutter/engine#6310.
Fixes #20998, and fixes #14344