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/macros.h"
14#include "flutter/fml/mapping.h"
19class MultiArchShaderArchive;
32 std::string
name)
const;
36 const std::string&
name,
37 const std::shared_ptr<fml::Mapping>& mapping)>&)
50 static_cast<std::underlying_type_t<decltype(
key.
type)
>>(
key.type),
56 bool operator()(
const ShaderKey& lhs,
const ShaderKey& rhs)
const {
57 return lhs.type == rhs.type && lhs.name == rhs.name;
62 using Shaders = std::unordered_map<
ShaderKey,
63 std::shared_ptr<fml::Mapping>,
67 std::shared_ptr<const fml::Mapping> payload_;
69 bool is_valid_ =
false;
71 explicit ShaderArchive(std::shared_ptr<const fml::Mapping> payload);
ShaderArchive(ShaderArchive &&)
size_t IterateAllShaders(const std::function< bool(ArchiveShaderType type, const std::string &name, const std::shared_ptr< fml::Mapping > &mapping)> &) const
size_t GetShaderCount() const
std::shared_ptr< fml::Mapping > GetMapping(ArchiveShaderType type, std::string name) const
constexpr std::size_t HashCombine()
bool operator()(const ShaderKey &lhs, const ShaderKey &rhs) const
size_t operator()(const ShaderKey &key) const