| 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 ()=0

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

## ◆ IOSSurface()

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

Definition at line 40 of file ios_surface.mm.

41 : ios_context_(std::move(ios_context)) {
42 FML_DCHECK(ios_context_);
43 }

## 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()) {
26 case IOSRenderingBackend::kSkia:
27 [FlutterLogger logFatal:@"Impeller opt-out unavailable."];
28 return nullptr;
29 case IOSRenderingBackend::kImpeller:
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 }
flutter::IOSRenderingBackend::kImpeller
@ kImpeller
flutter::IOSRenderingBackend::kSkia
@ kSkia
METAL_IOS_VERSION_BASELINE
#define METAL_IOS_VERSION_BASELINE
Definition: rendering_api_selection.h:40

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

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