Flutter Engine
 
Loading...
Searching...
No Matches
flutter::UIDartState::Context Struct Reference

The subset of state which is owned by the shell or engine and passed through the RuntimeController into DartIsolates. If a shell-owned resource needs to be exposed to the framework via UIDartState, a pointer to the resource can be added to this struct with appropriate default construction. More...

#include <ui_dart_state.h>

Public Member Functions

 Context (const TaskRunners &task_runners)
 
 Context (const TaskRunners &task_runners, fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > snapshot_delegate, fml::WeakPtr< IOManager > io_manager, fml::RefPtr< SkiaUnrefQueue > unref_queue, fml::TaskRunnerAffineWeakPtr< ImageDecoder > image_decoder, fml::TaskRunnerAffineWeakPtr< ImageGeneratorRegistry > image_generator_registry, std::string advisory_script_uri, std::string advisory_script_entrypoint, bool deterministic_rendering_enabled, std::shared_ptr< fml::ConcurrentTaskRunner > concurrent_task_runner, std::shared_future< impeller::RuntimeStageBackend > runtime_stage_backend, bool enable_impeller, bool enable_flutter_gpu)
 

Public Attributes

const TaskRunners task_runners
 
fml::TaskRunnerAffineWeakPtr< SnapshotDelegatesnapshot_delegate
 
fml::WeakPtr< IOManagerio_manager
 The IO manager used by the isolate for asynchronous texture uploads.
 
fml::RefPtr< SkiaUnrefQueueunref_queue
 
fml::TaskRunnerAffineWeakPtr< ImageDecoderimage_decoder
 The image decoder.
 
fml::TaskRunnerAffineWeakPtr< ImageGeneratorRegistryimage_generator_registry
 
std::string advisory_script_uri
 
std::string advisory_script_entrypoint
 
bool deterministic_rendering_enabled = false
 Whether deterministic rendering practices should be used.
 
std::shared_ptr< fml::ConcurrentTaskRunnerconcurrent_task_runner
 
std::shared_future< impeller::RuntimeStageBackendruntime_stage_backend
 The runtime stage backend for fragment shaders.
 
bool enable_impeller = false
 Whether Impeller is enabled or not.
 
bool enable_flutter_gpu = false
 Whether flutter_gpu is enabled or not.
 

Detailed Description

The subset of state which is owned by the shell or engine and passed through the RuntimeController into DartIsolates. If a shell-owned resource needs to be exposed to the framework via UIDartState, a pointer to the resource can be added to this struct with appropriate default construction.

Definition at line 46 of file ui_dart_state.h.

Constructor & Destructor Documentation

◆ Context() [1/2]

flutter::UIDartState::Context::Context ( const TaskRunners task_runners)
explicit

Definition at line 19 of file ui_dart_state.cc.

◆ Context() [2/2]

flutter::UIDartState::Context::Context ( const TaskRunners task_runners,
fml::TaskRunnerAffineWeakPtr< SnapshotDelegate snapshot_delegate,
fml::WeakPtr< IOManager io_manager,
fml::RefPtr< SkiaUnrefQueue unref_queue,
fml::TaskRunnerAffineWeakPtr< ImageDecoder image_decoder,
fml::TaskRunnerAffineWeakPtr< ImageGeneratorRegistry image_generator_registry,
std::string  advisory_script_uri,
std::string  advisory_script_entrypoint,
bool  deterministic_rendering_enabled,
std::shared_ptr< fml::ConcurrentTaskRunner concurrent_task_runner,
std::shared_future< impeller::RuntimeStageBackend runtime_stage_backend,
bool  enable_impeller,
bool  enable_flutter_gpu 
)

Definition at line 22 of file ui_dart_state.cc.

39 io_manager(std::move(io_manager)),
40 unref_queue(std::move(unref_queue)),
41 image_decoder(std::move(image_decoder)),
fml::RefPtr< SkiaUnrefQueue > unref_queue
bool enable_flutter_gpu
Whether flutter_gpu is enabled or not.
fml::WeakPtr< IOManager > io_manager
The IO manager used by the isolate for asynchronous texture uploads.
std::shared_future< impeller::RuntimeStageBackend > runtime_stage_backend
The runtime stage backend for fragment shaders.
fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > snapshot_delegate
bool enable_impeller
Whether Impeller is enabled or not.
fml::TaskRunnerAffineWeakPtr< ImageDecoder > image_decoder
The image decoder.
std::shared_ptr< fml::ConcurrentTaskRunner > concurrent_task_runner
bool deterministic_rendering_enabled
Whether deterministic rendering practices should be used.
fml::TaskRunnerAffineWeakPtr< ImageGeneratorRegistry > image_generator_registry

Member Data Documentation

◆ advisory_script_entrypoint

std::string flutter::UIDartState::Context::advisory_script_entrypoint

The advisory script entrypoint (only used for debugging). This does not affect the code being run in the isolate in any way. The isolate must be transitioned to the running state explicitly by the caller.

Definition at line 98 of file ui_dart_state.h.

Referenced by flutter::testing::CreateAndRunRootIsolate(), flutter::DartIsolate::CreatePlatformIsolate(), flutter::testing::RunDartCodeInIsolateOnUITaskRunner(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::PlatformIsolateManagerTest::TestWithRootIsolate().

◆ advisory_script_uri

◆ concurrent_task_runner

std::shared_ptr<fml::ConcurrentTaskRunner> flutter::UIDartState::Context::concurrent_task_runner

The task runner whose tasks may be executed concurrently on a pool of shared worker threads.

Definition at line 105 of file ui_dart_state.h.

Referenced by flutter::UIDartState::GetConcurrentTaskRunner(), and flutter::RuntimeController::Spawn().

◆ deterministic_rendering_enabled

bool flutter::UIDartState::Context::deterministic_rendering_enabled = false

Whether deterministic rendering practices should be used.

Definition at line 101 of file ui_dart_state.h.

Referenced by flutter::UIDartState::IsDeterministicRenderingEnabled(), and flutter::RuntimeController::Spawn().

◆ enable_flutter_gpu

bool flutter::UIDartState::Context::enable_flutter_gpu = false

Whether flutter_gpu is enabled or not.

Definition at line 114 of file ui_dart_state.h.

Referenced by flutter::UIDartState::IsFlutterGPUEnabled(), and flutter::RuntimeController::Spawn().

◆ enable_impeller

bool flutter::UIDartState::Context::enable_impeller = false

◆ image_decoder

fml::TaskRunnerAffineWeakPtr<ImageDecoder> flutter::UIDartState::Context::image_decoder

The image decoder.

Definition at line 83 of file ui_dart_state.h.

Referenced by flutter::UIDartState::GetImageDecoder().

◆ image_generator_registry

fml::TaskRunnerAffineWeakPtr<ImageGeneratorRegistry> flutter::UIDartState::Context::image_generator_registry

Cascading registry of image generator builders. Given compressed image bytes as input, this is used to find and create image generators, which can then be used for image decoding.

Definition at line 89 of file ui_dart_state.h.

Referenced by flutter::UIDartState::GetImageGeneratorRegistry().

◆ io_manager

fml::WeakPtr<IOManager> flutter::UIDartState::Context::io_manager

The IO manager used by the isolate for asynchronous texture uploads.

Definition at line 76 of file ui_dart_state.h.

Referenced by flutter::UIDartState::GetIOManager(), flutter::RuntimeController::GetIOManager(), and flutter::testing::RunDartCodeInIsolateOnUITaskRunner().

◆ runtime_stage_backend

std::shared_future<impeller::RuntimeStageBackend> flutter::UIDartState::Context::runtime_stage_backend

The runtime stage backend for fragment shaders.

Definition at line 108 of file ui_dart_state.h.

Referenced by flutter::UIDartState::GetRuntimeStageBackend(), and flutter::RuntimeController::Spawn().

◆ snapshot_delegate

fml::TaskRunnerAffineWeakPtr<SnapshotDelegate> flutter::UIDartState::Context::snapshot_delegate

The snapshot delegate used by the isolate to gather raster snapshots of Flutter view hierarchies.

Definition at line 73 of file ui_dart_state.h.

Referenced by flutter::UIDartState::GetSnapshotDelegate(), and flutter::RuntimeController::GetSnapshotDelegate().

◆ task_runners

const TaskRunners flutter::UIDartState::Context::task_runners

The task runners used by the shell hosting this runtime controller. This may be used by the isolate to scheduled asynchronous texture uploads or post tasks to the platform task runner.

Definition at line 68 of file ui_dart_state.h.

Referenced by flutter::UIDartState::GetTaskRunners(), flutter::testing::RunDartCodeInIsolateOnUITaskRunner(), and flutter::RuntimeController::Spawn().

◆ unref_queue

fml::RefPtr<SkiaUnrefQueue> flutter::UIDartState::Context::unref_queue

The unref queue used by the isolate to collect resources that may reference resources on the GPU.

Definition at line 80 of file ui_dart_state.h.

Referenced by flutter::UIDartState::GetSkiaUnrefQueue(), flutter::RuntimeController::GetSkiaUnrefQueue(), and flutter::RuntimeController::Spawn().


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