Michael Klimushyn 770536ab6c
Only overflow the cache for one required frame (#7048)
Previously codec.cc needed all required frames to already be decoded
before it could decode any of their dependent frames. To accomplish this
it would always cache required frames, regardless of cache limit.

However both GIF and WEBP (the only currently supported animated image
formats) only allow the image to depend on one decoded frame at a time.
This means that there's no reason to cache all the required frames since
it's only valid for the image formats to require one previously decoded
frame at a time. (For example, frame 10 and frame 11 in a hypothetical
animated image could all depend on frame 9. But no subsequent frame
after frame 9 could depend on frames 0-8.)

Frames are always added to the cache as long as they're under the limit,
and never removed. Required frames are always stored as a separate
member on `MultiFrameCodec`.

Warning: this logic will break if we decide to support more animated
formats in the future.

Fixes flutter/flutter#24835.
2018-12-21 16:55:54 -08:00
..
2018-11-07 12:24:35 -08:00
2018-11-07 12:24:35 -08:00
2018-11-07 12:24:35 -08:00
2018-11-07 12:24:35 -08:00
2018-11-07 12:24:35 -08:00
2018-11-07 12:24:35 -08:00
2018-11-07 12:24:35 -08:00
2018-11-07 12:24:35 -08:00
2018-11-07 12:24:35 -08:00
2018-12-18 20:08:46 -08:00