| Flutter iOS Embedder |

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:

## 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 (GrDirectContext *gr_context=nullptr)=0

## Static Public Member Functions
static std::unique_ptr< IOSSurface > | Create (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 | ( |  | ) |
| virtual default

## ◆ IOSSurface()

flutter::IOSSurface::IOSSurface | ( | std::shared_ptr< IOSContext > | ios_context | ) |
| explicit protected

Definition at line 49 of file ios_surface.mm.

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

## 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()) {
24 case IOSRenderingBackend::kSkia:
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;
35 case IOSRenderingBackend::kImpeller:
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 }

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

Implemented in flutter::IOSSurfaceSoftware.

Referenced by flutter::FlutterPlatformViewLayerPool::GetLayer.

## ◆ GetContext()

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

Definition at line 56 of file ios_surface.mm.

56 {
57 return ios_context_;
58 }

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:

- shell/platform/darwin/ios/ios_surface.h
- shell/platform/darwin/ios/ios_surface.mm

flutter::IOSRenderingBackend::kSkia
@ kSkia
flutter::IOSRenderingBackend::kImpeller
@ kImpeller
METAL_IOS_VERSION_BASELINE
#define METAL_IOS_VERSION_BASELINE
Definition: rendering_api_selection.h:40