| Flutter Impeller |

Public Member Functions | List of all members
impeller::glvk::AutoTrampolineContext Class Referencefinal

An RAII object that makes the trampolines EGL context current when constructed and clears the EGL binding on destruction. More...

`#include <trampoline.h>`

## Public Member Functions
| AutoTrampolineContext (const Trampoline &trampoline)
| Constructs a new instance and makes the trampolines EGL context current on the calling thread. More...
| ~AutoTrampolineContext ()
| Destroys the object and clears the previous EGL binding. More...
| AutoTrampolineContext (const AutoTrampolineContext &)=delete
AutoTrampolineContext & | operator= (const AutoTrampolineContext &)=delete

## Detailed Description

An RAII object that makes the trampolines EGL context current when constructed and clears the EGL binding on destruction.

Definition at line 127 of file trampoline.h.

## Constructor & Destructor Documentation

## ◆ AutoTrampolineContext() [1/2]

impeller::glvk::AutoTrampolineContext::AutoTrampolineContext | ( | const Trampoline & | trampoline | ) |
| explicit

Constructs a new instance and makes the trampolines EGL context current on the calling thread.

Parameters

  [in] | trampoline | The trampoline.

Definition at line 318 of file trampoline.cc.

319 : context_(trampoline.egl_context_.get()),
320 surface_(trampoline.egl_surface_.get()) {
321 if (!context_->IsCurrent() && !context_->MakeCurrent(*surface_)) {
322 VALIDATION_LOG << "Could not make context current.";
323 }
324 };

References impeller::egl::Context::IsCurrent(), impeller::egl::Context::MakeCurrent(), and VALIDATION_LOG.

## ◆ ~AutoTrampolineContext()

impeller::glvk::AutoTrampolineContext::~AutoTrampolineContext | ( |  | ) |

Destroys the object and clears the previous EGL binding.

Definition at line 326 of file trampoline.cc.

326 {
327 if (!context_->ClearCurrent()) {
328 VALIDATION_LOG << "Could not clear current context.";
329 }
330 }

References impeller::egl::Context::ClearCurrent(), and VALIDATION_LOG.

## ◆ AutoTrampolineContext() [2/2]

impeller::glvk::AutoTrampolineContext::AutoTrampolineContext | ( | const AutoTrampolineContext & |  | ) |
| delete

## Member Function Documentation

## ◆ operator=()

AutoTrampolineContext& impeller::glvk::AutoTrampolineContext::operator= | ( | const AutoTrampolineContext & |  | ) |
| delete

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

- impeller/toolkit/glvk/trampoline.h
- impeller/toolkit/glvk/trampoline.cc

impeller::egl::Context::MakeCurrent
bool MakeCurrent(const Surface &surface) const
Make the context current on the calling thread. It is the caller responsibility to ensure that any co...
Definition: context.cc:45
impeller::egl::Context::IsCurrent
bool IsCurrent() const
Definition: context.cc:102
impeller::egl::Context::ClearCurrent
bool ClearCurrent() const
Clear the thread association of this context.
Definition: context.cc:61
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:91