5 #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_SKIA_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_SKIA_H_
10 #include "flutter/fml/macros.h"
11 #include "flutter/shell/gpu/gpu_surface_metal_delegate.h"
13 #include "third_party/skia/include/gpu/ganesh/mtl/GrMtlTypes.h"
20 public GPUSurfaceMetalDelegate {
23 std::shared_ptr<IOSContext> context);
29 fml::scoped_nsobject<CAMetalLayer> layer_;
30 id<MTLDevice> device_;
31 id<MTLCommandQueue> command_queue_;
32 bool is_valid_ =
false;
35 bool IsValid()
const override;
38 void UpdateStorageSizeIfNecessary()
override;
41 std::unique_ptr<Surface> CreateGPUSurface(GrDirectContext* gr_context)
override;
44 GPUCAMetalLayerHandle GetCAMetalLayer(
const SkISize& frame_info)
const override
45 __attribute__((cf_audited_transfer));
48 bool PresentDrawable(GrMTLHandle drawable)
const override __attribute__((cf_audited_transfer));
51 GPUMTLTextureInfo GetMTLTexture(
const SkISize& frame_info)
const override
52 __attribute__((cf_audited_transfer));
55 bool PresentTexture(GPUMTLTextureInfo texture)
const override
56 __attribute__((cf_audited_transfer));
59 bool AllowsDrawingWhenGpuDisabled()
const override;
68 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_SKIA_H_