mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[Impeller] disable lossy texture compression. (#170596)
Fixes https://github.com/flutter/flutter/issues/170056 Fixes https://github.com/flutter/flutter/issues/170089 Lossy texture compression can cause rendering artifacts in certain kinds of images. Disable automatic application of it.
This commit is contained in:
parent
c23b2d0498
commit
c64e652bfe
@ -321,7 +321,6 @@ ImageDecoderImpeller::UnsafeUploadTextureToPrivate(
|
||||
texture_descriptor.format = pixel_format.value();
|
||||
texture_descriptor.size = {image_info.width(), image_info.height()};
|
||||
texture_descriptor.mip_count = texture_descriptor.size.MipCount();
|
||||
texture_descriptor.compression_type = impeller::CompressionType::kLossy;
|
||||
if (context->GetBackendType() == impeller::Context::BackendType::kMetal &&
|
||||
resize_info.has_value()) {
|
||||
// The MPS used to resize images on iOS does not require mip generation.
|
||||
@ -370,7 +369,6 @@ ImageDecoderImpeller::UnsafeUploadTextureToPrivate(
|
||||
resize_desc.format = pixel_format.value();
|
||||
resize_desc.size = {resize_info->width(), resize_info->height()};
|
||||
resize_desc.mip_count = resize_desc.size.MipCount();
|
||||
resize_desc.compression_type = impeller::CompressionType::kLossy;
|
||||
resize_desc.usage = impeller::TextureUsage::kShaderRead;
|
||||
if (context->GetBackendType() == impeller::Context::BackendType::kMetal) {
|
||||
// Resizing requires a MPS on Metal platforms.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user