[Impeller] Decode images at nearest supported size, and then resize of necessary.#33767
[Impeller] Decode images at nearest supported size, and then resize of necessary.#33767bdero merged 5 commits intoflutter:mainfrom
Conversation
…d scale if necessary
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
| /// 2. If the decoded image isn't the right target size, resize it. | ||
| /// | ||
|
|
||
| const auto scaled_image_info = image_info.makeDimensions(target_size); |
There was a problem hiding this comment.
Perhaps another TRACE_EVENT("impeller", "DecodeScale"); here?
|
Expanded an existing Skia decoder test to run the Impeller decoder in the same way (fails prior to the fix). |
…resize of necessary. (flutter/engine#33767)
Fixes flutter/flutter#104217.
The framework can request images be decoded into smaller sizes. A subset of image generators support subpixel decoding at some sizes, and a subset of those support arbitrary pixel decoding. This change makes the Impeller decoder decode into a buffer at the closest supported size by the generator, and then resizes the pixel data into a new buffer. (Which is what we do for Skia).