Flutter iOS Embedder
ios_surface.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_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_H_
7 
9 
10 #include <memory>
11 
12 #include "flutter/flow/embedded_views.h"
13 #include "flutter/flow/surface.h"
14 #include "flutter/fml/macros.h"
15 
16 @class CALayer;
17 
18 namespace flutter {
19 
20 class IOSSurface {
21  public:
22  static std::unique_ptr<IOSSurface> Create(const std::shared_ptr<IOSContext>& context,
23  CALayer* layer);
24 
25  std::shared_ptr<IOSContext> GetContext() const;
26 
27  virtual ~IOSSurface();
28 
29  virtual bool IsValid() const = 0;
30 
31  virtual void UpdateStorageSizeIfNecessary() = 0;
32 
33  virtual std::unique_ptr<Surface> CreateGPUSurface() = 0;
34 
35  protected:
36  explicit IOSSurface(std::shared_ptr<IOSContext> ios_context);
37 
38  private:
39  std::shared_ptr<IOSContext> ios_context_;
40 
41  FML_DISALLOW_COPY_AND_ASSIGN(IOSSurface);
42 };
43 
44 } // namespace flutter
45 
46 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_H_
virtual bool IsValid() const =0
IOSSurface(std::shared_ptr< IOSContext > ios_context)
Definition: ios_surface.mm:38
virtual void UpdateStorageSizeIfNecessary()=0
std::shared_ptr< IOSContext > GetContext() const
Definition: ios_surface.mm:45
virtual std::unique_ptr< Surface > CreateGPUSurface()=0
static std::unique_ptr< IOSSurface > Create(const std::shared_ptr< IOSContext > &context, CALayer *layer)
Definition: ios_surface.mm:18