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>
Public Member Functions | |
virtual | ~IOSContext () |
Collects the context object. This must happen on the thread on which this object was created. More... | |
virtual IOSRenderingBackend | GetBackend () const |
Get the rendering backend used by this context. 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 (IOSRenderingAPI api, IOSRenderingBackend backend, 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 () | |
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 39 of file ios_context.h.
|
virtualdefault |
Collects the context object. This must happen on the thread on which this object was created.
|
explicitprotecteddefault |
|
static |
Create an iOS context object capable of creating the on-screen and off-screen GPU context for use by Impeller.
In case the engine does not support the specified client rendering API, this a nullptr
may be returned.
[in] | api | A client rendering API supported by the engine/platform. |
[in] | backend | A client rendering backend supported by the engine/platform. |
nullptr
on failure. Definition at line 21 of file ios_context.mm.
References flutter::kImpeller, flutter::kMetal, flutter::kSkia, and flutter::kSoftware.
|
pure virtual |
Creates an external texture proxy of the appropriate client rendering API.
[in] | texture_id | The texture identifier |
[in] | texture | The texture |
Implemented in flutter::IOSContextNoop.
|
virtual |
Definition at line 59 of file ios_context.mm.
|
virtual |
Get the rendering backend used by this context.
Reimplemented in flutter::IOSContextNoop, and flutter::IOSContextMetalImpeller.
Definition at line 50 of file ios_context.mm.
References flutter::kSkia.
|
virtual |
Definition at line 55 of file ios_context.mm.