5 #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_IMPELLER_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_IMPELLER_H_
8 #include "flutter/fml/macros.h"
9 #include "flutter/shell/gpu/gpu_surface_metal_delegate.h"
22 public GPUSurfaceMetalDelegate {
25 const std::shared_ptr<IOSContext>& context);
31 fml::scoped_nsobject<CAMetalLayer> layer_;
32 const std::shared_ptr<impeller::Context> impeller_context_;
33 bool is_valid_ =
false;
36 bool IsValid()
const override;
39 void UpdateStorageSizeIfNecessary()
override;
42 std::unique_ptr<Surface> CreateGPUSurface(GrDirectContext* gr_context)
override;
45 GPUCAMetalLayerHandle GetCAMetalLayer(
const SkISize& frame_info)
const override
46 __attribute__((cf_audited_transfer));
49 bool PresentDrawable(GrMTLHandle drawable)
const override __attribute__((cf_audited_transfer));
52 GPUMTLTextureInfo GetMTLTexture(
const SkISize& frame_info)
const override
53 __attribute__((cf_audited_transfer));
56 bool PresentTexture(GPUMTLTextureInfo texture)
const override
57 __attribute__((cf_audited_transfer));
60 bool AllowsDrawingWhenGpuDisabled()
const override;
67 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_IMPELLER_H_