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
 
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)
 

Protected Member Functions

 IOSSurface (std::shared_ptr< IOSContext > ios_context)
 

Detailed Description

Definition at line 25 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)
explicitprotected

Definition at line 48 of file ios_surface.mm.

References FML_DCHECK, and ~IOSSurface().

49  : ios_context_(std::move(ios_context)) {
50  FML_DCHECK(ios_context_);
51 }
#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 
)
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 flutter::PlatformViewIOS::attachView(), and flutter::FlutterPlatformViewLayerPool::GetLayer.

19  {
20  FML_DCHECK(layer);
21  FML_DCHECK(context);
22 
23  if ([layer.get() isKindOfClass:[CAEAGLLayer class]]) {
24  return std::make_unique<IOSSurfaceGL>(
26  reinterpret_cast<CAEAGLLayer*>([layer.get() retain])), // EAGL layer
27  std::move(context) // context
28  );
29  }
30 
31 #if SHELL_ENABLE_METAL
32  if (@available(iOS METAL_IOS_VERSION_BASELINE, *)) {
33  if ([layer.get() isKindOfClass:[CAMetalLayer class]]) {
34  return std::make_unique<IOSSurfaceMetal>(
36  reinterpret_cast<CAMetalLayer*>([layer.get() retain])), // Metal layer
37  std::move(context) // context
38  );
39  }
40  }
41 #endif // SHELL_ENABLE_METAL
42 
43  return std::make_unique<IOSSurfaceSoftware>(std::move(layer), // layer
44  std::move(context) // context
45  );
46 }
#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

◆ 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: