| Flutter Impeller |

Public Member Functions | Static Public Member Functions | List of all members
impeller::interop::ContextMTL Class Referencefinal

`#include <context_mtl.h>`

Inheritance diagram for impeller::interop::ContextMTL:

## Public Member Functions
| ~ContextMTL () override
| ContextMTL (const ContextMTL &)=delete
ContextMTL & | operator= (const ContextMTL &)=delete
const std::shared_ptr< SwapchainTransientsMTL > & | GetSwapchainTransients () const
Public Member Functions inherited from impeller::interop::Context
| ~Context () override
| Context (const Context &)=delete
Context & | operator= (const Context &)=delete
bool | IsValid () const
std::shared_ptr< impeller::Context > | GetContext () const
AiksContext & | GetAiksContext ()
bool | IsBackend (impeller::Context::BackendType type) const
bool | IsGL () const
bool | IsMetal () const
bool | IsVulkan () const
Public Member Functions inherited from impeller::interop::ObjectBase
| ObjectBase ()=default
virtual | ~ObjectBase ()=default
| ObjectBase (const ObjectBase &)=delete
| ObjectBase (ObjectBase &&)=delete
ObjectBase & | operator= (const ObjectBase &)=delete
ObjectBase & | operator= (ObjectBase &&)=delete
void | Retain ()
void | Release ()
uint64_t | GetRefCountForTests () const

## Static Public Member Functions
static ScopedObject< Context > | Create ()
static ScopedObject< Context > | Create (const std::shared_ptr< impeller::Context > &context)
Static Public Member Functions inherited from impeller::interop::ObjectBase
static void | SafeRetain (void *ptr)
static void | SafeRelease (void *ptr)

## Additional Inherited Members
Public Types inherited from impeller::interop::Object< Context, IMPELLER_INTERNAL_HANDLE_NAME(ImpellerContext)>
using | InteropClass = Context
using | InteropCSibling = IMPELLER_INTERNAL_HANDLE_NAME(ImpellerContext)
Protected Member Functions inherited from impeller::interop::Context
| Context (std::shared_ptr< impeller::Context > context)

## Detailed Description

Definition at line 13 of file context_mtl.h.

## Constructor & Destructor Documentation

## ◆ ~ContextMTL()

impeller::interop::ContextMTL::~ContextMTL | ( |  | ) |
| override default

## ◆ ContextMTL()

impeller::interop::ContextMTL::ContextMTL | ( | const ContextMTL & |  | ) |
| delete

Referenced by Create().

## Member Function Documentation

## ◆ Create() [1/2]

ScopedObject< Context > impeller::interop::ContextMTL::Create | ( |  | ) |
| static

Definition at line 29 of file context_mtl.mm.

29 {
30 auto impeller_context =
31 impeller::ContextMTL::Create(Flags{}, CreateShaderLibraryMappings(), //
32 std::make_shared<fml::SyncSwitch>(), //
33 "Impeller" //
34 );
35 if (!impeller_context) {
36 VALIDATION_LOG << "Could not create Impeller context.";
37 return {};
38 }
39 return Create(std::move(impeller_context));
40 }
impeller::ContextMTL::Create
static std::shared_ptr< ContextMTL > Create(const Flags &flags, const std::vector< std::string > &shader_library_paths, std::shared_ptr< const fml::SyncSwitch > is_gpu_disabled_sync_switch)
Definition: context_mtl.mm:232
impeller::interop::ContextMTL::Create
static ScopedObject< Context > Create()
Definition: context_mtl.mm:29
impeller::interop::CreateShaderLibraryMappings
static std::vector< std::shared_ptr< fml::Mapping > > CreateShaderLibraryMappings()
Definition: context_mtl.mm:17
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:91

References impeller::ContextMTL::Create(), impeller::interop::CreateShaderLibraryMappings(), and VALIDATION_LOG.

Referenced by impeller::interop::testing::CreateSharedContext(), and impeller::interop::ImpellerContextCreateMetalNew().

## ◆ Create() [2/2]

ScopedObject< Context > impeller::interop::ContextMTL::Create | ( | const std::shared_ptr< impeller::Context > & | context | ) |
| static

Definition at line 42 of file context_mtl.mm.

43 {
44 // Can't call Create because of private constructor. Adopt the raw pointer
45 // instead.
46 auto context = Adopt<Context>(new ContextMTL(impeller_context));
47 if (!context->IsValid()) {
48 VALIDATION_LOG << " Could not create valid context.";
49 return {};
50 }
51 return context;
52 }
impeller::interop::ContextMTL::ContextMTL
ContextMTL(const ContextMTL &)=delete

References ContextMTL(), and VALIDATION_LOG.

## ◆ GetSwapchainTransients()

const std::shared_ptr< SwapchainTransientsMTL > & impeller::interop::ContextMTL::GetSwapchainTransients | ( |  | ) | const

Definition at line 62 of file context_mtl.mm.

62 {
63 return swapchain_transients_;
64 }

## ◆ operator=()

ContextMTL& impeller::interop::ContextMTL::operator= | ( | const ContextMTL & |  | ) |
| delete

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

- impeller/toolkit/interop/backend/metal/context_mtl.h
- impeller/toolkit/interop/backend/metal/context_mtl.mm