Flutter Engine
The Flutter Engine
third_party
skia
src
gpu
graphite
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
8
#include "
src/gpu/graphite/RuntimeEffectDictionary.h
"
9
10
#include "
src/core/SkRuntimeEffectPriv.h
"
11
12
namespace
skgpu::graphite
{
13
14
void
RuntimeEffectDictionary::set
(
int
codeSnippetID,
sk_sp<const SkRuntimeEffect>
effect) {
15
// The same code-snippet ID should never refer to two different effects.
16
SkASSERT
(!fDict.
find
(codeSnippetID) || (
SkRuntimeEffectPriv::Hash
(*fDict[codeSnippetID]) ==
17
SkRuntimeEffectPriv::Hash
(*effect)));
18
fDict.
set
(codeSnippetID, std::move(effect));
19
}
20
21
}
// namespace skgpu::graphite
RuntimeEffectDictionary.h
SkASSERT
#define SkASSERT(cond)
Definition:
SkAssert.h:116
SkRuntimeEffectPriv.h
SkRuntimeEffectPriv::Hash
static uint32_t Hash(const SkRuntimeEffect &effect)
Definition:
SkRuntimeEffectPriv.h:78
sk_sp< const SkRuntimeEffect >
skgpu::graphite::RuntimeEffectDictionary::set
void set(int codeSnippetID, sk_sp< const SkRuntimeEffect > effect)
Definition:
RuntimeEffectDictionary.cpp:14
skia_private::THashMap::find
V * find(const K &key) const
Definition:
SkTHash.h:494
skia_private::THashMap::set
V * set(K key, V val)
Definition:
SkTHash.h:487
skgpu::graphite
Definition:
BoundsManagerBench.cpp:27
Generated on Sun Jun 23 2024 21:56:27 for Flutter Engine by
1.9.4