diff --git a/engine/src/flutter/shell/gpu/gpu_surface_metal_impeller.mm b/engine/src/flutter/shell/gpu/gpu_surface_metal_impeller.mm index 8d5a549526..94f77a1ec1 100644 --- a/engine/src/flutter/shell/gpu/gpu_surface_metal_impeller.mm +++ b/engine/src/flutter/shell/gpu/gpu_surface_metal_impeller.mm @@ -208,6 +208,10 @@ Surface::SurfaceData GPUSurfaceMetalImpeller::GetSurfaceData() const { bytesPerPixel = 4; pixel_format = "MTLPixelFormatBGRA8Unorm"; break; + case MTLPixelFormatRGBA16Float: + bytesPerPixel = 8; + pixel_format = "MTLPixelFormatRGBA16Float"; + break; default: return {}; } diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.mm index ae9fbffe14..91d4f472a6 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterView.mm @@ -107,7 +107,11 @@ CGColorSpaceRef srgb = CGColorSpaceCreateWithName(kCGColorSpaceExtendedSRGB); layer.colorspace = srgb; CFRelease(srgb); - layer.pixelFormat = MTLPixelFormatBGRA10_XR; + // MTLPixelFormatRGBA16Float was chosen since it is compatible with + // impeller's offscreen buffers which need to have transparency. Also, + // F16 was chosen over BGRA10_XR since Skia does not support decoding + // BGRA10_XR. + layer.pixelFormat = MTLPixelFormatRGBA16Float; } }