Only cache required frames#8837
Conversation
lib/ui/painting.dart
Outdated
| Future<Codec> instantiateImageCodec(Uint8List list, { | ||
| double decodedCacheRatioCap = 0, | ||
| }) { | ||
| Future<Codec> instantiateImageCodec(Uint8List list) { |
There was a problem hiding this comment.
We should follow the breaking changes protocol here and below
mklim
left a comment
There was a problem hiding this comment.
We should follow the breaking changes protocol here and below
I followed the policy for the framework PR: flutter/flutter#32041. Do you think there should be an additional announcement for the dart:ui changes?
I think we should make another announcement as we didn't announce a breaking change to |
Makes sense. Posted an announcement to https://groups.google.com/forum/#!topic/flutter-announce/LXAL4RjbkT0. |
amirh
left a comment
There was a problem hiding this comment.
LGTM
One caveat is the discussion we had offline regarding whether to keep frameInfos_ or not, since I can't currently tell which option is better I'm ok with both, but happy to take another look if you want to change that part.
Talked to Skia and it sounds like we're not really saving anything by creating and managing the |
Remove the extra `decodedCacheRatioCap` parameter, and the `_frameBitmaps` member from `Codec`. This means that small looped images will consume more CPU but prevents us from hitting OOM exceptions based on trying to render multiple larger images.
Previously we looped over every single SkCodec::FrameInfo, tracked its `fRequiredFrame`, and then saved any frames matching those indeces. Doing this instead avoids that initialization loop and extra data structure.
Also adds some missing `const`s.
flutter/engine@f4d23ef...904cfc4 git log f4d23ef..904cfc4 --no-merges --oneline 904cfc4 Add @UiThread to MethodChannel and related classes/calls (#32642). (flutter/engine#8947) c9406d4 Roll src/third_party/skia d696f8e6bca3..0221e8b22687 (5 commits) (flutter/engine#8948) 1b649a5 update docs (flutter/engine#8928) 47fd66c Terminate debug background task on expiry (flutter/engine#8930) 14c82d9 Only cache required frames (flutter/engine#8837) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff ([email protected]), and stop the roller if necessary.
Remove the extra `decodedCacheRatioCap` parameter, and the `_frameBitmaps` member from `Codec`. This means that small looped images will consume more CPU but prevents us from hitting OOM exceptions based on trying to render multiple larger images. Also switch to fDisposalMethod for caching frames. Previously we looped over every single SkCodec::FrameInfo, tracked its `fRequiredFrame`, and then saved any frames matching those indeces. Doing this instead avoids that initialization loop and extra data structure.
Remove the extra
decodedCacheRatioCapparameter, and the_frameBitmapsmember fromCodec. This means that small looped imageswill consume more CPU but prevents us from hitting OOM exceptions based
on trying to render multiple larger images.
Breaking Change: https://groups.google.com/forum/#!topic/flutter-announce/LXAL4RjbkT0
Fixes flutter/flutter#26081