| Flutter Impeller |

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

`#include <context_gles.h>`

Inheritance diagram for impeller::interop::ContextGLES:

## Public Member Functions
| ContextGLES ()
| ~ContextGLES () override
| ContextGLES (const ContextGLES &)=delete
ContextGLES & | operator= (const ContextGLES &)=delete
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 (std::function< void *(const char *gl_proc_name)> proc_address_callback)
static ScopedObject< Context > | Create (std::shared_ptr< impeller::Context > context, std::shared_ptr< ReactorWorkerGLES > worker=nullptr)
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 16 of file context_gles.h.

## Constructor & Destructor Documentation

## ◆ ContextGLES() [1/2]

impeller::interop::ContextGLES::ContextGLES | ( |  | ) |

Referenced by Create().

## ◆ ~ContextGLES()

impeller::interop::ContextGLES::~ContextGLES | ( |  | ) |
| overridedefault

## ◆ ContextGLES() [2/2]

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

## Member Function Documentation

## ◆ Create() [1/2]

ScopedObject< Context > impeller::interop::ContextGLES::Create | ( | std::function< void *(const char *gl_proc_name)> | proc_address_callback | ) |
| static

Definition at line 14 of file context_gles.cc.

15 {
16 auto proc_table = std::make_unique<ProcTableGLES>(
17 impeller::ProcTableGLES(std::move(proc_address_callback)));
18 if (!proc_table || !proc_table->IsValid()) {
19 VALIDATION_LOG << "Could not create valid OpenGL ES proc. table.";
20 return {};
21 }
22 std::vector<std::shared_ptr<fml::Mapping>> shader_mappings = {
23 std::make_shared<fml::NonOwnedMapping>(
24 impeller_entity_shaders_gles_data,
25 impeller_entity_shaders_gles_length),
26 std::make_shared<fml::NonOwnedMapping>(
27 impeller_framebuffer_blend_shaders_gles_data,
28 impeller_framebuffer_blend_shaders_gles_length),
29 };
30 auto impeller_context = impeller::ContextGLES::Create(
31 Flags{}, std::move(proc_table), shader_mappings, false);
32 if (!impeller_context) {
33 VALIDATION_LOG << "Could not create Impeller context.";
34 return {};
35 }
36 auto reactor_worker = std::make_shared<ReactorWorkerGLES>();
37 auto worker_id = impeller_context->AddReactorWorker(reactor_worker);
38 if (!worker_id.has_value()) {
39 VALIDATION_LOG << "Could not add reactor worker.";
40 return {};
41 }
42 return Create(std::move(impeller_context), std::move(reactor_worker));
43 }
impeller::ContextGLES::Create
static std::shared_ptr< ContextGLES > Create(const Flags &flags, std::unique_ptr< ProcTableGLES > gl, const std::vector< std::shared_ptr< fml::Mapping >> &shader_libraries, bool enable_gpu_tracing)
Definition: context_gles.cc:21
impeller::ProcTableGLES
Definition: proc_table_gles.h:283
impeller::interop::ContextGLES::Create
static ScopedObject< Context > Create(std::function< void *(const char *gl_proc_name)> proc_address_callback)
Definition: context_gles.cc:14
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:91

References impeller::ContextGLES::Create(), and VALIDATION_LOG.

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

## ◆ Create() [2/2]

ScopedObject< Context > impeller::interop::ContextGLES::Create | ( | std::shared_ptr< impeller::Context > | context,
|  | std::shared_ptr< ReactorWorkerGLES > | worker = `nullptr`
| ) |  |
| static

Definition at line 45 of file context_gles.cc.

47 {
48 // Can't call Create because of private constructor. Adopt the raw pointer
49 // instead.
50 auto context = Adopt<Context>(
51 new ContextGLES(std::move(impeller_context), std::move(worker)));
52
53 if (!context->IsValid()) {
54 VALIDATION_LOG << "Could not create valid context.";
55 return {};
56 }
57 return context;
58 }
impeller::interop::ContextGLES::ContextGLES
ContextGLES()

References ContextGLES(), and VALIDATION_LOG.

## ◆ operator=()

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

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

- impeller/toolkit/interop/backend/gles/context_gles.h
- impeller/toolkit/interop/backend/gles/context_gles.cc