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

Public Member Functions

 ReactorWorker ()=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 embedder_surface_gl_impeller.cc.

Constructor & Destructor Documentation

◆ ReactorWorker()

flutter::ReactorWorker::ReactorWorker ( )
default

Member Function Documentation

◆ CanReactorReactOnCurrentThreadNow()

bool flutter::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 26 of file embedder_surface_gl_impeller.cc.

27 {
28 impeller::ReaderLock lock(mutex_);
29 auto found = reactions_allowed_.find(std::this_thread::get_id());
30 if (found == reactions_allowed_.end()) {
31 return false;
32 }
33 return found->second;
34 }

◆ SetReactionsAllowedOnCurrentThread()

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

Definition at line 36 of file embedder_surface_gl_impeller.cc.

36 {
37 impeller::WriterLock lock(mutex_);
38 reactions_allowed_[std::this_thread::get_id()] = allowed;
39 }

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