Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
skgpu::graphite::RuntimeEffectDictionary Class Reference

#include <RuntimeEffectDictionary.h>

Public Member Functions

const SkRuntimeEffectfind (int codeSnippetID) const
 
void set (int codeSnippetID, sk_sp< const SkRuntimeEffect > effect)
 
void reset ()
 

Detailed Description

Definition at line 22 of file RuntimeEffectDictionary.h.

Member Function Documentation

◆ find()

const SkRuntimeEffect * skgpu::graphite::RuntimeEffectDictionary::find ( int  codeSnippetID) const
inline

Definition at line 24 of file RuntimeEffectDictionary.h.

24 {
25 sk_sp<const SkRuntimeEffect>* effect = fDict.find(codeSnippetID);
26 return effect ? effect->get() : nullptr;
27 }
V * find(const K &key) const
Definition: SkTHash.h:494

◆ reset()

void skgpu::graphite::RuntimeEffectDictionary::reset ( )
inline

Definition at line 31 of file RuntimeEffectDictionary.h.

31{ fDict.reset(); }

◆ set()

void skgpu::graphite::RuntimeEffectDictionary::set ( int  codeSnippetID,
sk_sp< const SkRuntimeEffect effect 
)

Definition at line 14 of file RuntimeEffectDictionary.cpp.

14 {
15 // The same code-snippet ID should never refer to two different effects.
16 SkASSERT(!fDict.find(codeSnippetID) || (SkRuntimeEffectPriv::Hash(*fDict[codeSnippetID]) ==
18 fDict.set(codeSnippetID, std::move(effect));
19}
#define SkASSERT(cond)
Definition: SkAssert.h:116
static uint32_t Hash(const SkRuntimeEffect &effect)
V * set(K key, V val)
Definition: SkTHash.h:487

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