Flutter Engine
The Flutter Engine
RuntimeEffectDictionary.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2022 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
9
11
12namespace skgpu::graphite {
13
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}
20
21} // namespace skgpu::graphite
#define SkASSERT(cond)
Definition: SkAssert.h:116
static uint32_t Hash(const SkRuntimeEffect &effect)
void set(int codeSnippetID, sk_sp< const SkRuntimeEffect > effect)
V * find(const K &key) const
Definition: SkTHash.h:494
V * set(K key, V val)
Definition: SkTHash.h:487