• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_H_
7 
8 #import "flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h"
9 
10 #include <memory>
11 
12 #include "flutter/fml/macros.h"
13 #include "flutter/fml/platform/darwin/scoped_nsobject.h"
14 #include "flutter/shell/common/surface.h"
15 
16 namespace flutter {
17 
18 // Returns true if the app explicitly specified to use the iOS view embedding
19 // mechanism which is still in a release preview.
20 bool IsIosEmbeddedViewsPreviewEnabled();
21 
22 class IOSSurface {
23  public:
24   IOSSurface(FlutterPlatformViewsController* platform_views_controller);
25 
26   virtual ~IOSSurface();
27 
28   virtual bool IsValid() const = 0;
29 
30   virtual bool ResourceContextMakeCurrent() = 0;
31 
32   virtual void UpdateStorageSizeIfNecessary() = 0;
33 
34   virtual std::unique_ptr<Surface> CreateGPUSurface() = 0;
35 
36  protected:
37   FlutterPlatformViewsController* GetPlatformViewsController();
38 
39  private:
40   FlutterPlatformViewsController* platform_views_controller_;
41 
42  public:
43   FML_DISALLOW_COPY_AND_ASSIGN(IOSSurface);
44 };
45 
46 }  // namespace flutter
47 
48 #endif  // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_H_
49