Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
skgpu::graphite::PipelineDataCache< T > Class Template Reference

#include <PipelineDataCache.h>

Public Member Functions

 PipelineDataCache ()=default
 
const Tinsert (const T &dataBlock)
 
int count () const
 
template<typename Fn >
void foreach (Fn &&fn) const
 

Detailed Description

template<typename T>
class skgpu::graphite::PipelineDataCache< T >

Definition at line 27 of file PipelineDataCache.h.

Constructor & Destructor Documentation

◆ PipelineDataCache()

template<typename T >
skgpu::graphite::PipelineDataCache< T >::PipelineDataCache ( )
default

Member Function Documentation

◆ count()

template<typename T >
int skgpu::graphite::PipelineDataCache< T >::count ( ) const
inline

Definition at line 45 of file PipelineDataCache.h.

45 {
46 return fDataPointers.count();
47 }
int count() const
Definition SkTHash.h:564

◆ foreach()

template<typename T >
template<typename Fn >
void skgpu::graphite::PipelineDataCache< T >::foreach ( Fn &&  fn) const
inline

Definition at line 51 of file PipelineDataCache.h.

51 {
52 fDataPointers.foreach([fn](const DataRef& ref){
53 fn(ref.fPointer);
54 });
55 }
void foreach(Fn &&fn) const
Definition SkTHash.h:590

◆ insert()

template<typename T >
const T * skgpu::graphite::PipelineDataCache< T >::insert ( const T dataBlock)
inline

Definition at line 31 of file PipelineDataCache.h.

31 {
32 DataRef data{&dataBlock}; // will not be persisted, since pointer isn't from the arena.
33 const DataRef* existing = fDataPointers.find(data);
34 if (existing) {
35 return existing->fPointer;
36 } else {
37 // Need to make a copy of dataBlock into the arena
38 T* copy = T::Make(dataBlock, &fArena);
39 fDataPointers.add(DataRef{copy});
40 return copy;
41 }
42 }
const T * find(const T &item) const
Definition SkTHash.h:580
void add(T item)
Definition SkTHash.h:573
Definition copy.py:1
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switches.h:41
#define T

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