Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::AndroidContextGLImpeller::ReactorWorker Class Referencefinal
Inheritance diagram for flutter::AndroidContextGLImpeller::ReactorWorker:
impeller::ReactorGLES::Worker

Public Member Functions

 ReactorWorker ()=default
 
 ~ReactorWorker () override=default
 
bool CanReactorReactOnCurrentThreadNow (const impeller::ReactorGLES &reactor) const override
 Determines the ability of the worker to service a reaction on the current thread. The OpenGL context must be current on the thread if the worker says it is able to service a reaction. More...
 
void SetReactionsAllowedOnCurrentThread (bool allowed)
 
- Public Member Functions inherited from impeller::ReactorGLES::Worker
virtual ~Worker ()=default
 
virtual bool CanReactorReactOnCurrentThreadNow (const ReactorGLES &reactor) const =0
 Determines the ability of the worker to service a reaction on the current thread. The OpenGL context must be current on the thread if the worker says it is able to service a reaction. More...
 

Detailed Description

Definition at line 21 of file android_context_gl_impeller.cc.

Constructor & Destructor Documentation

◆ ReactorWorker()

flutter::AndroidContextGLImpeller::ReactorWorker::ReactorWorker ( )
default

◆ ~ReactorWorker()

flutter::AndroidContextGLImpeller::ReactorWorker::~ReactorWorker ( )
overridedefault

Member Function Documentation

◆ CanReactorReactOnCurrentThreadNow()

bool flutter::AndroidContextGLImpeller::ReactorWorker::CanReactorReactOnCurrentThreadNow ( const impeller::ReactorGLES reactor) const
inlineoverridevirtual

Determines the ability of the worker to service a reaction on the current thread. The OpenGL context must be current on the thread if the worker says it is able to service a reaction.

Parameters
[in]reactorThe reactor
Returns
If the worker is able to service a reaction. The reactor assumes the context is already current if true.

Implements impeller::ReactorGLES::Worker.

Definition at line 30 of file android_context_gl_impeller.cc.

31 {
32 impeller::ReaderLock lock(mutex_);
33 auto found = reactions_allowed_.find(std::this_thread::get_id());
34 if (found == reactions_allowed_.end()) {
35 return false;
36 }
37 return found->second;
38 }

◆ SetReactionsAllowedOnCurrentThread()

void flutter::AndroidContextGLImpeller::ReactorWorker::SetReactionsAllowedOnCurrentThread ( bool  allowed)
inline

Definition at line 40 of file android_context_gl_impeller.cc.

40 {
41 impeller::WriterLock lock(mutex_);
42 reactions_allowed_[std::this_thread::get_id()] = allowed;
43 }

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