Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
impeller::PipelineLibrary Class Referenceabstract

#include <pipeline_library.h>

Inheritance diagram for impeller::PipelineLibrary:
impeller::PipelineLibraryGLES impeller::PipelineLibraryMTL impeller::PipelineLibraryVK impeller::testing::MockPipelineLibrary

Public Member Functions

virtual ~PipelineLibrary ()
 
PipelineFuture< PipelineDescriptorGetPipeline (std::optional< PipelineDescriptor > descriptor, bool async=true)
 
PipelineFuture< ComputePipelineDescriptorGetPipeline (std::optional< ComputePipelineDescriptor > descriptor, bool async=true)
 
virtual bool IsValid () const =0
 
virtual PipelineFuture< PipelineDescriptorGetPipeline (PipelineDescriptor descriptor, bool async=true, bool threadsafe=false)=0
 Creates a pipeline.
 
virtual PipelineFuture< ComputePipelineDescriptorGetPipeline (ComputePipelineDescriptor descriptor, bool async=true)=0
 
virtual bool HasPipeline (const PipelineDescriptor &descriptor)=0
 
virtual void RemovePipelinesWithEntryPoint (std::shared_ptr< const ShaderFunction > function)=0
 
void LogPipelineUsage (const PipelineDescriptor &p)
 
void LogPipelineCreation (const PipelineDescriptor &p)
 
std::unordered_map< PipelineDescriptor, int, ComparableHash< PipelineDescriptor >, ComparableEqual< PipelineDescriptor > > GetPipelineUseCounts () const
 

Protected Member Functions

 PipelineLibrary ()
 

Detailed Description

Definition at line 32 of file pipeline_library.h.

Constructor & Destructor Documentation

◆ ~PipelineLibrary()

impeller::PipelineLibrary::~PipelineLibrary ( )
virtualdefault

◆ PipelineLibrary()

impeller::PipelineLibrary::PipelineLibrary ( )
protecteddefault

Member Function Documentation

◆ GetPipeline() [1/4]

virtual PipelineFuture< ComputePipelineDescriptor > impeller::PipelineLibrary::GetPipeline ( ComputePipelineDescriptor  descriptor,
bool  async = true 
)
pure virtual

◆ GetPipeline() [2/4]

virtual PipelineFuture< PipelineDescriptor > impeller::PipelineLibrary::GetPipeline ( PipelineDescriptor  descriptor,
bool  async = true,
bool  threadsafe = false 
)
pure virtual

Creates a pipeline.

Parameters
[in]descriptorThe descriptor of the texture to create.
[in]asyncWhether to allow pipeline creation to be deferred. If false, pipeline creation will block on the current thread.
[in]threadsafeWhether mutations to this texture should be protected with a threadsafe barrier.

This parameter only affects the OpenGLES rendering backend.

If any interaction with this texture (including creation) will be done on a thread other than where the OpenGLES context resides, then threadsafe, must be set to true.

◆ GetPipeline() [3/4]

PipelineFuture< ComputePipelineDescriptor > impeller::PipelineLibrary::GetPipeline ( std::optional< ComputePipelineDescriptor descriptor,
bool  async = true 
)

Definition at line 29 of file pipeline_library.cc.

31 {
32 if (descriptor.has_value()) {
33 return GetPipeline(descriptor.value(), async);
34 }
35 auto promise = std::make_shared<
36 std::promise<std::shared_ptr<Pipeline<ComputePipelineDescriptor>>>>();
37 promise->set_value(nullptr);
38 return {descriptor, promise->get_future()};
39}
PipelineFuture< PipelineDescriptor > GetPipeline(std::optional< PipelineDescriptor > descriptor, bool async=true)

References GetPipeline().

◆ GetPipeline() [4/4]

PipelineFuture< PipelineDescriptor > impeller::PipelineLibrary::GetPipeline ( std::optional< PipelineDescriptor descriptor,
bool  async = true 
)

Definition at line 17 of file pipeline_library.cc.

19 {
20 if (descriptor.has_value()) {
21 return GetPipeline(descriptor.value(), async);
22 }
23 auto promise = std::make_shared<
24 std::promise<std::shared_ptr<Pipeline<PipelineDescriptor>>>>();
25 promise->set_value(nullptr);
26 return {descriptor, promise->get_future()};
27}

References GetPipeline().

Referenced by GetPipeline(), and GetPipeline().

◆ GetPipelineUseCounts()

std::unordered_map< PipelineDescriptor, int, ComparableHash< PipelineDescriptor >, ComparableEqual< PipelineDescriptor > > impeller::PipelineLibrary::GetPipelineUseCounts ( ) const

Definition at line 63 of file pipeline_library.cc.

63 {
64 std::unordered_map<PipelineDescriptor, int,
65 ComparableHash<PipelineDescriptor>,
66 ComparableEqual<PipelineDescriptor>>
67 counts;
68
69#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG || \
70 FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_PROFILE
71 ReaderLock lock(pipeline_use_counts_mutex_);
72 counts = pipeline_use_counts_;
73#endif
74 return counts;
75}
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core counts

Referenced by impeller::testing::TEST(), and impeller::testing::TEST().

◆ HasPipeline()

virtual bool impeller::PipelineLibrary::HasPipeline ( const PipelineDescriptor descriptor)
pure virtual

◆ IsValid()

virtual bool impeller::PipelineLibrary::IsValid ( ) const
pure virtual

◆ LogPipelineCreation()

void impeller::PipelineLibrary::LogPipelineCreation ( const PipelineDescriptor p)

Definition at line 41 of file pipeline_library.cc.

41 {
42#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG || \
43 FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_PROFILE
44 WriterLock lock(pipeline_use_counts_mutex_);
45 if (!pipeline_use_counts_.contains(p)) {
46 pipeline_use_counts_[p] = 0;
47 }
48#endif
49}

◆ LogPipelineUsage()

void impeller::PipelineLibrary::LogPipelineUsage ( const PipelineDescriptor p)

Definition at line 51 of file pipeline_library.cc.

51 {
52#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG || \
53 FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_PROFILE
54 WriterLock lock(pipeline_use_counts_mutex_);
55 ++pipeline_use_counts_[p];
56#endif
57}

Referenced by impeller::testing::TEST(), and impeller::testing::TEST().

◆ RemovePipelinesWithEntryPoint()

virtual void impeller::PipelineLibrary::RemovePipelinesWithEntryPoint ( std::shared_ptr< const ShaderFunction function)
pure virtual

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