Flutter Engine
flutter::IOSSurface Class Referenceabstract

#include <ios_surface.h>

Inheritance diagram for flutter::IOSSurface:
flutter::IOSSurfaceGL flutter::IOSSurfaceMetal flutter::IOSSurfaceSoftware

Public Member Functions

std::shared_ptr< IOSContextGetContext () const
 
std::shared_ptr< IOSExternalViewEmbedderGetSurfaceExternalViewEmbedder () const
 
virtual ~IOSSurface ()
 
virtual bool IsValid () const =0
 
virtual void UpdateStorageSizeIfNecessary ()=0
 
virtual std::unique_ptr< SurfaceCreateGPUSurface (GrDirectContext *gr_context=nullptr)=0
 

Static Public Member Functions

static std::unique_ptr< IOSSurfaceCreate (std::shared_ptr< IOSContext > context, fml::scoped_nsobject< CALayer > layer, const std::shared_ptr< FlutterPlatformViewsController > &platform_views_controller)
 

Protected Member Functions

 IOSSurface (std::shared_ptr< IOSContext > ios_context, const std::shared_ptr< FlutterPlatformViewsController > &platform_views_controller)
 

Detailed Description

Definition at line 26 of file ios_surface.h.

Constructor & Destructor Documentation

◆ ~IOSSurface()

flutter::IOSSurface::~IOSSurface ( )
virtualdefault

Referenced by IOSSurface().

◆ IOSSurface()

flutter::IOSSurface::IOSSurface ( std::shared_ptr< IOSContext ios_context,
const std::shared_ptr< FlutterPlatformViewsController > &  platform_views_controller 
)
protected

Definition at line 54 of file ios_surface.mm.

References FML_DCHECK, and ~IOSSurface().

57  : ios_context_(std::move(ios_context)) {
58  FML_DCHECK(ios_context_);
59  external_view_embedder_ =
60  std::make_shared<IOSExternalViewEmbedder>(platform_views_controller, ios_context_);
61 }
#define FML_DCHECK(condition)
Definition: logging.h:86

Member Function Documentation

◆ Create()

std::unique_ptr< IOSSurface > flutter::IOSSurface::Create ( std::shared_ptr< IOSContext context,
fml::scoped_nsobject< CALayer >  layer,
const std::shared_ptr< FlutterPlatformViewsController > &  platform_views_controller 
)
static

Definition at line 18 of file ios_surface.mm.

References FML_DCHECK, fml::scoped_nsprotocol< NST >::get(), and METAL_IOS_VERSION_BASELINE.

Referenced by FlutterView::createSurface:, and FlutterOverlayView::createSurface:.

21  {
22  FML_DCHECK(layer);
23  FML_DCHECK(context);
24 
25  if ([layer.get() isKindOfClass:[CAEAGLLayer class]]) {
26  return std::make_unique<IOSSurfaceGL>(
28  reinterpret_cast<CAEAGLLayer*>([layer.get() retain])), // EAGL layer
29  std::move(context), // context
30  platform_views_controller // platform views controller
31  );
32  }
33 
34 #if FLUTTER_SHELL_ENABLE_METAL
35  if (@available(iOS METAL_IOS_VERSION_BASELINE, *)) {
36  if ([layer.get() isKindOfClass:[CAMetalLayer class]]) {
37  return std::make_unique<IOSSurfaceMetal>(
39  reinterpret_cast<CAMetalLayer*>([layer.get() retain])), // Metal layer
40  std::move(context), // context
41  platform_views_controller // platform views controller
42  );
43  }
44  }
45 #endif // FLUTTER_SHELL_ENABLE_METAL
46 
47  return std::make_unique<IOSSurfaceSoftware>(
48  std::move(layer), // layer
49  std::move(context), // context
50  platform_views_controller // platform views controller
51  );
52 }
#define FML_DCHECK(condition)
Definition: logging.h:86
#define METAL_IOS_VERSION_BASELINE

◆ CreateGPUSurface()

virtual std::unique_ptr<Surface> flutter::IOSSurface::CreateGPUSurface ( GrDirectContext *  gr_context = nullptr)
pure virtual

◆ GetContext()

std::shared_ptr< IOSContext > flutter::IOSSurface::GetContext ( ) const

Definition at line 65 of file ios_surface.mm.

Referenced by flutter::IOSSurfaceGL::GLContextMakeCurrent(), and flutter::IOSSurfaceMetal::IOSSurfaceMetal().

65  {
66  return ios_context_;
67 }

◆ GetSurfaceExternalViewEmbedder()

std::shared_ptr< IOSExternalViewEmbedder > flutter::IOSSurface::GetSurfaceExternalViewEmbedder ( ) const

◆ IsValid()

virtual bool flutter::IOSSurface::IsValid ( ) const
pure virtual

◆ UpdateStorageSizeIfNecessary()

virtual void flutter::IOSSurface::UpdateStorageSizeIfNecessary ( )
pure virtual

The documentation for this class was generated from the following files: