From c64e652bfe059ac48ba28d9231c6575d43540aab Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Fri, 13 Jun 2025 16:48:30 -0700 Subject: [PATCH] [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. --- engine/src/flutter/lib/ui/painting/image_decoder_impeller.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/engine/src/flutter/lib/ui/painting/image_decoder_impeller.cc b/engine/src/flutter/lib/ui/painting/image_decoder_impeller.cc index 763ee1b3345..b57b697bd44 100644 --- a/engine/src/flutter/lib/ui/painting/image_decoder_impeller.cc +++ b/engine/src/flutter/lib/ui/painting/image_decoder_impeller.cc @@ -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.