-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Make upscaling images opt-in #59856
Make upscaling images opt-in #59856
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.
LGTM
@@ -84,13 +84,15 @@ mixin PaintingBinding on BindingBase, ServicesBinding { | |||
Future<ui.Codec> instantiateImageCodec(Uint8List bytes, { | |||
int cacheWidth, | |||
int cacheHeight, | |||
bool allowUpscaling = false, |
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.
Can you add a sentence about this parameter to the doc comment above?
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.
I updated the docstring in general here - there were some old no-longer-existant things in there and some formatting issues, as well as something that's changed about aspect ratio preservation. PTAL
Cirrus failure are presumably resolved when the engine roll lands? |
Analysis issues are places in the code where I failed to fix up signatures. Will take a look and add the doc comment. |
My FROB run had lots of failures, but none of them seem related to this change. That's the best I can make of that :\ |
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.
Still LGTM
Thanks for the updated docs!
* Make upscaling images opt-in
Description
We should be discouraging users from upscaling images, which causes increased memory usage. This problem arises because users typically do not know the intrinsic dimensions of the compressed image data, and may be providing cache width/height values that exceed the dimensions of the image.
Once this lands, we can default the parameter to false in the engine as well.
/cc @zanderso @chinmaygarde FYI
Related Issues
Part of #59578
Engine side PR was flutter/engine#19067
Tests
Test that upscaling still works when the parameter is set to true
Test that downscaling works (previously untested)
Test that upscaling is not applied when the parameter is set to false.
Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.
I'll do a FROB run to make sure this breaks nothing internally.