5#ifndef FLUTTER_IMPELLER_SHADER_ARCHIVE_SHADER_ARCHIVE_H_
6#define FLUTTER_IMPELLER_SHADER_ARCHIVE_SHADER_ARCHIVE_H_
10#include <unordered_map>
12#include "flutter/fml/hash_combine.h"
13#include "flutter/fml/mapping.h"
20 explicit ShaderArchive(std::shared_ptr<fml::Mapping> payload);
31 std::string
name)
const;
35 const std::string&
name,
36 const std::shared_ptr<fml::Mapping>& mapping)>&)
47 static_cast<std::underlying_type_t<decltype(
key.
type)
>>(
key.type),
53 bool operator()(
const ShaderKey& lhs,
const ShaderKey& rhs)
const {
54 return lhs.type == rhs.type && lhs.name == rhs.name;
59 using Shaders = std::unordered_map<
ShaderKey,
60 std::shared_ptr<fml::Mapping>,
64 std::shared_ptr<fml::Mapping> payload_;
66 bool is_valid_ =
false;
ShaderArchive(ShaderArchive &&)
size_t IterateAllShaders(const std::function< bool(ArchiveShaderType type, const std::string &name, const std::shared_ptr< fml::Mapping > &mapping)> &) const
ShaderArchive(std::shared_ptr< fml::Mapping > payload)
size_t GetShaderCount() const
std::shared_ptr< fml::Mapping > GetMapping(ArchiveShaderType type, std::string name) const
Dart_NativeFunction function
static uint32_t Hash(uint32_t key)
DEF_SWITCHES_START aot vmservice shared library name
constexpr std::size_t HashCombine()
bool operator()(const ShaderKey &lhs, const ShaderKey &rhs) const
size_t operator()(const ShaderKey &key) const