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

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

## Member Function Documentation

## ◆ Create()

std::unique_ptr< IOSSurface > flutter::IOSSurface::Create | ( | std::shared_ptr< IOSContext > | context,
|  | CALayer * | layer
| ) |  |
| static

Definition at line 17 of file ios_surface.mm.

18 {
19 FML_DCHECK(layer);
20 FML_DCHECK(context);
21
22 if (@available(iOS METAL_IOS_VERSION_BASELINE, *)) {
23 if ([layer isKindOfClass:[CAMetalLayer class]]) {
24 switch (context->GetBackend()) {
25 case IOSRenderingBackend::kSkia:
26 FML_LOG(FATAL) << "Impeller opt-out unavailable.";
27 return nullptr;
28 case IOSRenderingBackend::kImpeller:
29 return std::make_unique<IOSSurfaceMetalImpeller>(
30 static_cast<CAMetalLayer*>(layer), // Metal layer
31 std::move(context) // context
32 );
33 }
34 }
35 }
36 return std::make_unique<IOSSurfaceNoop>(std::move(context));
37 }
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 46 of file ios_surface.mm.

46 {
47 return ios_context_;
48 }

## ◆ 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