Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
flutter::IOSSurface Class Referenceabstract

#include <ios_surface.h>

Inheritance diagram for flutter::IOSSurface:
flutter::IOSSurfaceMetalImpeller flutter::IOSSurfaceMetalSkia 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, const 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

◆ IOSSurface()

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

Definition at line 49 of file ios_surface.mm.

50 : ios_context_(std::move(ios_context)) {
51 FML_DCHECK(ios_context_);
52}
#define FML_DCHECK(condition)
Definition: logging.h:103

Member Function Documentation

◆ Create()

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

Definition at line 16 of file ios_surface.mm.

17 {
18 FML_DCHECK(layer);
19 FML_DCHECK(context);
20
21 if (@available(iOS METAL_IOS_VERSION_BASELINE, *)) {
22 if ([layer.get() isKindOfClass:[CAMetalLayer class]]) {
23 switch (context->GetBackend()) {
25#if !SLIMPELLER
26 return std::make_unique<IOSSurfaceMetalSkia>(
27 fml::scoped_nsobject<CAMetalLayer>((CAMetalLayer*)layer.get()), // Metal layer
28 std::move(context) // context
29 );
30#else // !SLIMPELLER
31 FML_LOG(FATAL) << "Impeller opt-out unavailable.";
32 return nullptr;
33#endif // !SLIMPELLER
34 break;
36 return std::make_unique<IOSSurfaceMetalImpeller>(
37 fml::scoped_nsobject<CAMetalLayer>((CAMetalLayer*)layer.get()), // Metal layer
38 std::move(context) // context
39 );
40 }
41 }
42 }
43
44 return std::make_unique<IOSSurfaceSoftware>(layer, // layer
45 std::move(context) // context
46 );
47}
T get() const __attribute((ns_returns_not_retained))
#define FATAL(error)
#define FML_LOG(severity)
Definition: logging.h:82
#define METAL_IOS_VERSION_BASELINE

◆ CreateGPUSurface()

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

Implemented in flutter::IOSSurfaceSoftware.

◆ GetContext()

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

Definition at line 56 of file ios_surface.mm.

56 {
57 return ios_context_;
58}

◆ IsValid()

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

Implemented in flutter::IOSSurfaceSoftware.

◆ UpdateStorageSizeIfNecessary()

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

Implemented in flutter::IOSSurfaceSoftware.


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