Flutter iOS Embedder
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< Surface > CreateGPUSurface (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 50 of file ios_surface.mm.

51  : ios_context_(std::move(ios_context)) {
52  FML_DCHECK(ios_context_);
53 }

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 18 of file ios_surface.mm.

19  {
20  FML_DCHECK(layer);
21  FML_DCHECK(context);
22 
23 #if SHELL_ENABLE_METAL
24  if (@available(iOS METAL_IOS_VERSION_BASELINE, *)) {
25  if ([layer.get() isKindOfClass:[CAMetalLayer class]]) {
26  switch (context->GetBackend()) {
28  return std::make_unique<IOSSurfaceMetalSkia>(
29  fml::scoped_nsobject<CAMetalLayer>(
30  reinterpret_cast<CAMetalLayer*>([layer.get() retain])), // Metal layer
31  std::move(context) // context
32  );
33  break;
35  return std::make_unique<IOSSurfaceMetalImpeller>(
36  fml::scoped_nsobject<CAMetalLayer>(
37  reinterpret_cast<CAMetalLayer*>([layer.get() retain])), // Metal layer
38  std::move(context) // context
39  );
40  }
41  }
42  }
43 #endif // SHELL_ENABLE_METAL
44 
45  return std::make_unique<IOSSurfaceSoftware>(layer, // layer
46  std::move(context) // context
47  );
48 }

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

Referenced by flutter::PlatformViewIOS::attachView().

◆ 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 57 of file ios_surface.mm.

57  {
58  return ios_context_;
59 }

Referenced by flutter::IOSSurfaceMetalSkia::IOSSurfaceMetalSkia().

◆ 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:
flutter::IOSRenderingBackend::kSkia
@ kSkia
flutter::IOSRenderingBackend::kImpeller
@ kImpeller
METAL_IOS_VERSION_BASELINE
#define METAL_IOS_VERSION_BASELINE
Definition: rendering_api_selection.h:40