Skip to content

Conversation

@mklim
Copy link
Contributor

@mklim mklim commented Sep 28, 2018

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.

Fixes #20998, and fixes #14344

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor

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)

mklim pushed a commit to flutter/engine that referenced this pull request Oct 10, 2018
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.
Michael Klimushyn added 2 commits October 11, 2018 10:12
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.
@mklim
Copy link
Contributor Author

mklim commented Oct 11, 2018

This is ready to merge now, the engine dependency has been rolled into the framework.

@Hixie
Copy link
Contributor

Hixie commented Oct 15, 2018

LGTM

@mklim mklim merged commit 6fef292 into flutter:master Oct 15, 2018
@mklim mklim deleted the gif_decode_limit branch October 15, 2018 18:22
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

3 participants