5 #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_SKIA_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_SKIA_H_
8 #include "flutter/fml/macros.h"
9 #include "flutter/shell/gpu/gpu_surface_metal_delegate.h"
11 #include "third_party/skia/include/gpu/ganesh/mtl/GrMtlTypes.h"
18 public GPUSurfaceMetalDelegate {
21 std::shared_ptr<IOSContext> context);
27 fml::scoped_nsobject<CAMetalLayer> layer_;
28 id<MTLDevice> device_;
29 id<MTLCommandQueue> command_queue_;
30 bool is_valid_ =
false;
33 bool IsValid()
const override;
36 void UpdateStorageSizeIfNecessary()
override;
39 std::unique_ptr<Surface> CreateGPUSurface(GrDirectContext* gr_context)
override;
42 GPUCAMetalLayerHandle GetCAMetalLayer(
const SkISize& frame_info)
const override;
45 bool PresentDrawable(GrMTLHandle drawable)
const override;
48 GPUMTLTextureInfo GetMTLTexture(
const SkISize& frame_info)
const override;
51 bool PresentTexture(GPUMTLTextureInfo texture)
const override;
54 bool AllowsDrawingWhenGpuDisabled()
const override;
61 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_SKIA_H_