| Flutter iOS Embedder |

ios_surface_metal_impeller.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_IMPELLER_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_IMPELLER_H_
7
8 #include "flutter/fml/macros.h"
9 #include "flutter/shell/gpu/gpu_surface_metal_delegate.h"
10 #include "flutter/shell/platform/darwin/ios/ios_surface.h"
11
12 @class CAMetalLayer;
13
14 namespace impeller {
15 class Context;
16 } // namespace impeller
17
18 namespace flutter {
19
20 class SK_API_AVAILABLE_CA_METAL_LAYER IOSSurfaceMetalImpeller final
21 : public IOSSurface,
22 public GPUSurfaceMetalDelegate {
23 public:
24 IOSSurfaceMetalImpeller(CAMetalLayer* layer, const std::shared_ptr<IOSContext>& context);
25
26 // |IOSSurface|
27 ~IOSSurfaceMetalImpeller();
28
29 private:
30 CAMetalLayer* layer_;
31 const std::shared_ptr<impeller::Context> impeller_context_;
32 std::shared_ptr<impeller::AiksContext> aiks_context_;
33 bool is_valid_ = false;
34
35 // |IOSSurface|
36 bool IsValid() const override;
37
38 // |IOSSurface|
39 void UpdateStorageSizeIfNecessary() override;
40
41 // |IOSSurface|
42 std::unique_ptr<Surface> CreateGPUSurface() override;
43
44 // |GPUSurfaceMetalDelegate|
45 GPUCAMetalLayerHandle GetCAMetalLayer(const DlISize& frame_info) const override
46 __attribute__((cf_audited_transfer));
47
48 // |GPUSurfaceMetalDelegate|
49 bool PresentDrawable(GrMTLHandle drawable) const override __attribute__((cf_audited_transfer));
50
51 // |GPUSurfaceMetalDelegate|
52 GPUMTLTextureInfo GetMTLTexture(const DlISize& frame_info) const override
53 __attribute__((cf_audited_transfer));
54
55 // |GPUSurfaceMetalDelegate|
56 bool PresentTexture(GPUMTLTextureInfo texture) const override
57 __attribute__((cf_audited_transfer));
58
59 // |GPUSurfaceMetalDelegate|
60 bool AllowsDrawingWhenGpuDisabled() const override;
61
62 FML_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceMetalImpeller);
63 };
64
65 } // namespace flutter
66
67 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_IMPELLER_H_
flutter::IOSSurface
Definition: ios_surface.h:20
flutter::IOSSurfaceMetalImpeller
Definition: ios_surface_metal_impeller.h:22
flutter::IOSSurfaceMetalImpeller::~IOSSurfaceMetalImpeller
~IOSSurfaceMetalImpeller()
ios_surface.h
flutter
Definition: accessibility_bridge.h:26
impeller
Definition: ios_context.h:20