Skip to content

Commit a5f6f60

Browse files
committed
[Impeller] Make Metal layers readable (flutter#41085)
Resolves flutter/flutter#124612. Doing this would also allow us to remove the final blit on iOS when advanced blends/backdrop filters are present (all of the facilities would remain in place for GLES + Vulkan though). (cherry picked from commit ef089a6)
1 parent 4842f0d commit a5f6f60

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

shell/platform/darwin/ios/ios_surface_metal_impeller.mm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
layer.drawableSize = drawable_size;
5353
}
5454

55+
// Flutter needs to read from the color attachment in cases where there are effects such as
56+
// backdrop filters. Flutter plugins that create platform views may also read from the layer.
57+
layer.framebufferOnly = NO;
58+
5559
// When there are platform views in the scene, the drawable needs to be presented in the same
5660
// transaction as the one created for platform views. When the drawable are being presented from
5761
// the raster thread, there is no such transaction.

shell/platform/darwin/ios/ios_surface_metal_skia.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
layer.pixelFormat = MTLPixelFormatBGRA8Unorm;
5757
// Flutter needs to read from the color attachment in cases where there are effects such as
58-
// backdrop filters.
58+
// backdrop filters. Flutter plugins that create platform views may also read from the layer.
5959
layer.framebufferOnly = NO;
6060

6161
const auto drawable_size = CGSizeMake(frame_info.width(), frame_info.height());

0 commit comments

Comments
 (0)