Flutter iOS Embedder
flutter::IOSContext Class Referenceabstract

Manages the lifetime of the on-screen and off-screen rendering contexts on iOS. On-screen contexts are used by Flutter for rendering into the surface. The lifecycle of this context may be tied to the lifecycle of the surface. On the other hand, the lifecycle of the off-screen context it tied to that of the platform view. This one object used to manage both context because GPU handles may need to be shared between the two context. To achieve this, context may need references to one another at creation time. This one object manages the creation, use and collection of both contexts in a client rendering API agnostic manner. More...

#include <ios_context.h>

Inheritance diagram for flutter::IOSContext:
FLUTTER_ASSERT_ARC::FakeIOSContext flutter::IOSContextMetalImpeller

Public Member Functions

virtual ~IOSContext ()
 Collects the context object. This must happen on the thread on which this object was created. More...
 
virtual std::unique_ptr< Texture > CreateExternalTexture (int64_t texture_id, NSObject< FlutterTexture > *texture)=0
 Creates an external texture proxy of the appropriate client rendering API. More...
 
virtual std::shared_ptr< impeller::Context > GetImpellerContext () const
 
virtual std::shared_ptr< impeller::AiksContext > GetAiksContext () const
 

Static Public Member Functions

static std::unique_ptr< IOSContext > Create (const std::shared_ptr< const fml::SyncSwitch > &is_gpu_disabled_sync_switch, const Settings &settings)
 Create an iOS context object capable of creating the on-screen and off-screen GPU context for use by Impeller. More...
 

Protected Member Functions

 IOSContext ()
 

Detailed Description

Manages the lifetime of the on-screen and off-screen rendering contexts on iOS. On-screen contexts are used by Flutter for rendering into the surface. The lifecycle of this context may be tied to the lifecycle of the surface. On the other hand, the lifecycle of the off-screen context it tied to that of the platform view. This one object used to manage both context because GPU handles may need to be shared between the two context. To achieve this, context may need references to one another at creation time. This one object manages the creation, use and collection of both contexts in a client rendering API agnostic manner.

Definition at line 38 of file ios_context.h.

Constructor & Destructor Documentation

◆ ~IOSContext()

flutter::IOSContext::~IOSContext ( )
virtualdefault

Collects the context object. This must happen on the thread on which this object was created.

◆ IOSContext()

flutter::IOSContext::IOSContext ( )
explicitprotecteddefault

Member Function Documentation

◆ Create()

std::unique_ptr< IOSContext > flutter::IOSContext::Create ( const std::shared_ptr< const fml::SyncSwitch > &  is_gpu_disabled_sync_switch,
const Settings &  settings 
)
static

Create an iOS context object capable of creating the on-screen and off-screen GPU context for use by Impeller.

Returns
A valid context on success. nullptr on failure.

Definition at line 21 of file ios_context.mm.

23  {
24  return std::make_unique<IOSContextMetalImpeller>(settings, is_gpu_disabled_sync_switch);
25 }

◆ CreateExternalTexture()

virtual std::unique_ptr<Texture> flutter::IOSContext::CreateExternalTexture ( int64_t  texture_id,
NSObject< FlutterTexture > *  texture 
)
pure virtual

Creates an external texture proxy of the appropriate client rendering API.

Parameters
[in]texture_idThe texture identifier
[in]textureThe texture
Returns
The texture proxy if the rendering backend supports embedder provided external textures.

Implemented in FLUTTER_ASSERT_ARC::FakeIOSContext.

◆ GetAiksContext()

std::shared_ptr< impeller::AiksContext > flutter::IOSContext::GetAiksContext ( ) const
virtual

Definition at line 31 of file ios_context.mm.

31  {
32  return nullptr;
33 }

◆ GetImpellerContext()

std::shared_ptr< impeller::Context > flutter::IOSContext::GetImpellerContext ( ) const
virtual

Definition at line 27 of file ios_context.mm.

27  {
28  return nullptr;
29 }

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