Flutter Engine
The Flutter Engine
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:579

◆ 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:609

◆ 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 }
static void copy(void *dst, const uint8_t *src, int width, int bpp, int deltaSrc, int offset, const SkPMColor ctable[])
Definition: SkSwizzler.cpp:31
const T * find(const T &item) const
Definition: SkTHash.h:599
void add(T item)
Definition: SkTHash.h:592
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
Definition: copy.py:1
#define T
Definition: precompiler.cc:65
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

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