MCPcopy Create free account
hub / github.com/Snapchat/Valdi / keyToFileName

Function keyToFileName

valdi/src/valdi/snap_drawing/Graphics/ShaderCache.cpp:28–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace snap::drawing {
27
28static Result<Valdi::Path> keyToFileName(const BytesView& key) {
29 if (key.data() == nullptr || key.empty()) {
30 return Error("Invalid key data object");
31 }
32
33 auto strHash = BytesUtils::sha256String(key);
34 return Valdi::Path(strHash);
35}
36
37static Result<Valdi::BytesView> skDataToByteView(const SkData& data) {
38 if (data.data() == nullptr || data.isEmpty()) {

Callers 2

loadShaderFromDiskMethod · 0.85
storeShaderToDiskMethod · 0.85

Calls 4

ErrorInterface · 0.50
PathClass · 0.50
dataMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected