Flutter Engine
 
Loading...
Searching...
No Matches
flutter::IOSSurface Class Referenceabstract

#include <ios_surface.h>

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

Public Member Functions

std::shared_ptr< IOSContextGetContext () const
 
virtual ~IOSSurface ()
 
virtual bool IsValid () const =0
 
virtual void UpdateStorageSizeIfNecessary ()=0
 
virtual std::unique_ptr< SurfaceCreateGPUSurface ()=0
 

Static Public Member Functions

static std::unique_ptr< IOSSurfaceCreate (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 40 of file ios_surface.mm.

41 : ios_context_(std::move(ios_context)) {
42 FML_DCHECK(ios_context_);
43}
#define FML_DCHECK(condition)
Definition logging.h:122

References FML_DCHECK.

Member Function Documentation

◆ Create()

std::unique_ptr< IOSSurface > flutter::IOSSurface::Create ( 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 switch (context->GetBackend()) {
27 [FlutterLogger logFatal:@"Impeller opt-out unavailable."];
28 return nullptr;
30 return std::make_unique<IOSSurfaceMetalImpeller>(
31 static_cast<CAMetalLayer*>(layer), // Metal layer
32 std::move(context) // context
33 );
34 }
35 }
36 }
37 return std::make_unique<IOSSurfaceNoop>(std::move(context));
38}
#define METAL_IOS_VERSION_BASELINE

References FML_DCHECK, flutter::kImpeller, flutter::kSkia, and METAL_IOS_VERSION_BASELINE.

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

◆ CreateGPUSurface()

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

Implemented in flutter::IOSSurfaceNoop.

◆ GetContext()

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

Definition at line 47 of file ios_surface.mm.

47 {
48 return ios_context_;
49}

◆ IsValid()

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

Implemented in flutter::IOSSurfaceNoop.

◆ UpdateStorageSizeIfNecessary()

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

Implemented in flutter::IOSSurfaceNoop.


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