Flutter Engine
ios_surface_metal.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_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_H_
7 
8 #include "flutter/fml/macros.h"
9 #include "flutter/shell/gpu/gpu_surface_delegate.h"
10 #import "flutter/shell/platform/darwin/ios/ios_surface.h"
11 #include "third_party/skia/include/gpu/mtl/GrMtlTypes.h"
12 
13 @class CAMetalLayer;
14 
15 namespace flutter {
16 
17 class SK_API_AVAILABLE_CA_METAL_LAYER IOSSurfaceMetal final : public IOSSurface,
18  public GPUSurfaceDelegate {
19  public:
21  std::shared_ptr<IOSContext> context,
22  FlutterPlatformViewsController* platform_views_controller);
23 
24  // |IOSSurface|
25  ~IOSSurfaceMetal() override;
26 
27  private:
29  bool is_valid_ = false;
30 
31  // |IOSSurface|
32  bool IsValid() const override;
33 
34  // |IOSSurface|
35  void UpdateStorageSizeIfNecessary() override;
36 
37  // |IOSSurface|
38  std::unique_ptr<Surface> CreateGPUSurface(GrDirectContext* gr_context) override;
39 
40  // |GPUSurfaceDelegate|
41  ExternalViewEmbedder* GetExternalViewEmbedder() override;
42 
44 };
45 
46 } // namespace flutter
47 
48 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_H_
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition: macros.h:27