Flutter iOS Embedder
flutter::IOSSurface Class Referenceabstract

#include <ios_surface.h>

Inheritance diagram for flutter::IOSSurface:
flutter::IOSSurfaceMetalImpeller

Public Member Functions

std::shared_ptr< IOSContext > GetContext () const
 
virtual ~IOSSurface ()
 
virtual bool IsValid () const =0
 
virtual void UpdateStorageSizeIfNecessary ()=0
 
virtual std::unique_ptr< Surface > CreateGPUSurface ()=0
 

Static Public Member Functions

static std::unique_ptr< IOSSurface > Create (const std::shared_ptr< IOSContext > &context, CALayer *layer)
 

Protected Member Functions

 IOSSurface (std::shared_ptr< IOSContext > ios_context)
 

Detailed Description

Definition at line 20 of file ios_surface.h.

Constructor & Destructor Documentation

◆ ~IOSSurface()

flutter::IOSSurface::~IOSSurface ( )
virtualdefault

◆ IOSSurface()

flutter::IOSSurface::IOSSurface ( std::shared_ptr< IOSContext >  ios_context)
explicitprotected

Definition at line 38 of file ios_surface.mm.

39  : ios_context_(std::move(ios_context)) {
40  FML_DCHECK(ios_context_);
41 }

Member Function Documentation

◆ Create()

std::unique_ptr< IOSSurface > flutter::IOSSurface::Create ( const std::shared_ptr< IOSContext > &  context,
CALayer *  layer 
)
static

Definition at line 18 of file ios_surface.mm.

19  {
20  FML_DCHECK(layer);
21  FML_DCHECK(context);
22 
23  if (@available(iOS METAL_IOS_VERSION_BASELINE, *)) {
24  if ([layer isKindOfClass:[CAMetalLayer class]]) {
25  return std::make_unique<IOSSurfaceMetalImpeller>(
26  static_cast<CAMetalLayer*>(layer), // Metal layer
27  context // context
28  );
29  }
30  }
31  // The layer MUST be a CAMetalLayer or FlutterMetalLayer, which overrides
32  // isKindOfClass to return true for the above check. Anything else means the
33  // rendering surface was misconfigured.
34  FML_CHECK(false) << "Expected a Metal-backed layer for iOS rendering.";
35  FML_UNREACHABLE();
36 }
#define METAL_IOS_VERSION_BASELINE

References METAL_IOS_VERSION_BASELINE.

Referenced by flutter::PlatformViewIOS::attachView(), and flutter::OverlayLayerPool::CreateLayer().

◆ CreateGPUSurface()

virtual std::unique_ptr<Surface> flutter::IOSSurface::CreateGPUSurface ( )
pure virtual

◆ GetContext()

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

Definition at line 45 of file ios_surface.mm.

45  {
46  return ios_context_;
47 }

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