From 4220180d9e2fc031f28a54010fbab49a4b7b3b8b Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Thu, 20 Apr 2023 19:10:14 -0700 Subject: [PATCH] [Impeller] Always use BGRA10_XR for wide gamut --- .../darwin/ios/framework/Source/FlutterView.mm | 6 +----- .../platform/darwin/ios/ios_surface_metal_impeller.mm | 11 +---------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterView.mm b/shell/platform/darwin/ios/framework/Source/FlutterView.mm index c441883999ad4..aa95fb844591d 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterView.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterView.mm @@ -96,11 +96,7 @@ - (void)layoutSubviews { CGColorSpaceRef srgb = CGColorSpaceCreateWithName(kCGColorSpaceExtendedSRGB); layer.colorspace = srgb; CFRelease(srgb); - if (self.opaque) { - layer.pixelFormat = MTLPixelFormatBGR10_XR; - } else { - layer.pixelFormat = MTLPixelFormatBGRA10_XR; - } + layer.pixelFormat = MTLPixelFormatBGRA10_XR; } } diff --git a/shell/platform/darwin/ios/ios_surface_metal_impeller.mm b/shell/platform/darwin/ios/ios_surface_metal_impeller.mm index b4a7436885daa..427b91e0fa6ba 100644 --- a/shell/platform/darwin/ios/ios_surface_metal_impeller.mm +++ b/shell/platform/darwin/ios/ios_surface_metal_impeller.mm @@ -10,15 +10,6 @@ namespace flutter { -static impeller::PixelFormat InferOffscreenLayerPixelFormat(impeller::PixelFormat pixel_format) { - switch (pixel_format) { - case impeller::PixelFormat::kB10G10R10XR: - return impeller::PixelFormat::kB10G10R10A10XR; - default: - return pixel_format; - } -} - IOSSurfaceMetalImpeller::IOSSurfaceMetalImpeller(const fml::scoped_nsobject& layer, const std::shared_ptr& context) : IOSSurface(context), @@ -47,7 +38,7 @@ // |IOSSurface| std::unique_ptr IOSSurfaceMetalImpeller::CreateGPUSurface(GrDirectContext*) { impeller_context_->UpdateOffscreenLayerPixelFormat( - InferOffscreenLayerPixelFormat(impeller::FromMTLPixelFormat(layer_.get().pixelFormat))); + impeller::FromMTLPixelFormat(layer_.get().pixelFormat)); return std::make_unique(this, // impeller_context_ // );