Would also solve:
Context: #123469
Today Impeller generates mipmaps by default when encoding images, see https://github.com/flutter/engine/blob/main/lib/ui/painting/image_decoder_impeller.cc#L339
However we've discovered that almost all flutter images will by default not use any miplevels. This means once we fix #147259 , most of this work is wasted. Instead of eagerly generating mipmaps, we should switch to a system where they are generated on demand if an image is rendered with a filter quality that requires it.
3条答案
按热度按时间5fjcxozz1#
FYI @matanlurey
thigvfpy2#
然而,我们发现几乎所有的Flutter图像默认情况下都不会使用任何mip等级。考虑到这些图像经常以非分辨率显示,这确实令人担忧。一般来说,
FilterQuality
API似乎非常难以使用。例如,将一个大图像作为一个小图标的理想情况需要具有三线性过滤的mip链。但是,今天,默认情况下将从基本mip级别中选择。这看起来是不正确的,并且性能不佳。但是,开发者应该如何选择更高的过滤质量是非常模糊的。我赞成为过滤和mip选择单独的控件,并废弃过滤质量API。我的感受是,人们会选择一个默认值并坚持使用它。那些真正需要控制mip级别的选择的应用现在将有一个涉及较少猜测的选项。bhmjp9jg3#
我认为这属于框架级别的重大变更,在短期内并非我们的责任。我们应该尽量忠实地遵守当前的渲染API,并为建议的改进提交错误报告。如果mipmaps应该是默认值,那么flutter图像应默认为FilterQuality.medium,据我所知,这是线性插值+mipmaps。