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...
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.
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.
- Parameters
-
[in] | api | A client rendering API supported by the engine/platform. |
[in] | backend | A client rendering backend supported by the engine/platform. |
- Returns
- A valid context on success.
nullptr
on failure.
Definition at line 23 of file ios_context.mm.
30 [FlutterLogger logImportant:
@"Software rendering is incompatible with Impeller.\n"
31 "Software rendering may have been automatically selected when "
32 "running on a simulator in an environment that does not support "
33 "Metal. Enabling GPU passthrough in your environment may fix "
35 return std::make_unique<IOSContextNoop>();
39 [FlutterLogger logFatal:
@"Impeller opt-out unavailable."];
42 return std::make_unique<IOSContextMetalImpeller>(settings, is_gpu_disabled_sync_switch);
References flutter::kImpeller, flutter::kMetal, flutter::kSkia, and flutter::kSoftware.