Flutter Engine
The Flutter Engine
ios_surface_metal_skia.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_SKIA_H_
6#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_SKIA_H_
7
8#if !SLIMPELLER
9
10#include "flutter/fml/macros.h"
11#include "flutter/shell/gpu/gpu_surface_metal_delegate.h"
12#import "flutter/shell/platform/darwin/ios/ios_surface.h"
14
15@class CAMetalLayer;
16
17namespace flutter {
18
19class SK_API_AVAILABLE_CA_METAL_LAYER IOSSurfaceMetalSkia final : public IOSSurface,
21 public:
23 std::shared_ptr<IOSContext> context);
24
25 // |IOSSurface|
27
28 private:
30 id<MTLDevice> device_;
31 id<MTLCommandQueue> command_queue_;
32 bool is_valid_ = false;
33
34 // |IOSSurface|
35 bool IsValid() const override;
36
37 // |IOSSurface|
38 void UpdateStorageSizeIfNecessary() override;
39
40 // |IOSSurface|
41 std::unique_ptr<Surface> CreateGPUSurface(GrDirectContext* gr_context) override;
42
43 // |GPUSurfaceMetalDelegate|
44 GPUCAMetalLayerHandle GetCAMetalLayer(const SkISize& frame_info) const override
45 __attribute__((cf_audited_transfer));
46
47 // |GPUSurfaceMetalDelegate|
48 bool PresentDrawable(GrMTLHandle drawable) const override __attribute__((cf_audited_transfer));
49
50 // |GPUSurfaceMetalDelegate|
51 GPUMTLTextureInfo GetMTLTexture(const SkISize& frame_info) const override
52 __attribute__((cf_audited_transfer));
53
54 // |GPUSurfaceMetalDelegate|
55 bool PresentTexture(GPUMTLTextureInfo texture) const override
56 __attribute__((cf_audited_transfer));
57
58 // |GPUSurfaceMetalDelegate|
59 bool AllowsDrawingWhenGpuDisabled() const override;
60
62};
63
64} // namespace flutter
65
66#endif // !SLIMPELLER
67
68#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_SKIA_H_
const void * GrMTLHandle
Definition: GrMtlTypes.h:20
Interface implemented by all platform surfaces that can present a metal backing store to the "screen"...
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition: macros.h:27
FlTexture * texture
struct flutter::ImageMetaData __attribute__((packed))
Definition: SkSize.h:16