Flutter Engine
The Flutter Engine
|
An interface used by Skia to schedule work on engine managed threads (usually workers in a concurrent message loop). More...
#include <skia_concurrent_executor.h>
Public Types | |
using | OnWorkCallback = std::function< void(fml::closure work)> |
Public Member Functions | |
SkiaConcurrentExecutor (const OnWorkCallback &on_work) | |
Create a new instance of the executor. More... | |
~SkiaConcurrentExecutor () override | |
void | add (fml::closure work) override |
Public Member Functions inherited from SkExecutor | |
virtual | ~SkExecutor () |
virtual void | add (std::function< void(void)>)=0 |
virtual void | borrow () |
Additional Inherited Members | |
Static Public Member Functions inherited from SkExecutor | |
static std::unique_ptr< SkExecutor > | MakeFIFOThreadPool (int threads=0, bool allowBorrowing=true) |
static std::unique_ptr< SkExecutor > | MakeLIFOThreadPool (int threads=0, bool allowBorrowing=true) |
static SkExecutor & | GetDefault () |
static void | SetDefault (SkExecutor *) |
Protected Member Functions inherited from SkExecutor | |
SkExecutor ()=default | |
SkExecutor (const SkExecutor &)=delete | |
SkExecutor & | operator= (const SkExecutor &)=delete |
An interface used by Skia to schedule work on engine managed threads (usually workers in a concurrent message loop).
Skia may decide that certain workloads don't have thread affinity and may be performed on a background thread. However, Skia does not manage its own threads. So, it delegates the scheduling of this work to the engine via this interface. The engine has a dedicated pool of threads it uses for scheduling background tasks that have no thread affinity. This thread worker pool is held next to the process global Dart VM instance. The Skia executor is wired up there as well.
Definition at line 27 of file skia_concurrent_executor.h.
using flutter::SkiaConcurrentExecutor::OnWorkCallback = std::function<void(fml::closure work)> |
The callback invoked by the executor to schedule the given task onto an engine managed background thread.
Definition at line 33 of file skia_concurrent_executor.h.
|
explicit |
Create a new instance of the executor.
[in] | on_work | The work callback. |
Definition at line 11 of file skia_concurrent_executor.cc.
|
overridedefault |
|
override |
Definition at line 16 of file skia_concurrent_executor.cc.