5#ifndef FLUTTER_LIB_GPU_SHADER_LIBRARY_H_
6#define FLUTTER_LIB_GPU_SHADER_LIBRARY_H_
10#include <unordered_map>
12#include "flutter/lib/gpu/export.h"
13#include "flutter/lib/gpu/shader.h"
14#include "flutter/lib/ui/dart_wrapper.h"
22 DEFINE_WRAPPERTYPEINFO();
26 using ShaderMap = std::unordered_map<std::string, fml::RefPtr<Shader>>;
30 const std::string&
name,
31 std::string& out_error);
37 std::shared_ptr<fml::Mapping> payload);
53 std::shared_ptr<fml::Mapping> payload_;
An immutable collection of shaders loaded from a shader bundle asset.
static void SetOverride(fml::RefPtr< ShaderLibrary > override_shader_library)
Sets a return override for MakeFromAsset for testing purposes.
static fml::RefPtr< ShaderLibrary > MakeFromAsset(impeller::Context::BackendType backend_type, const std::string &name, std::string &out_error)
~ShaderLibrary() override
static fml::RefPtr< ShaderLibrary > MakeFromShaders(ShaderMap shaders)
static fml::RefPtr< ShaderLibrary > MakeFromFlatbuffer(impeller::Context::BackendType backend_type, std::shared_ptr< fml::Mapping > payload)
std::unordered_map< std::string, fml::RefPtr< Shader > > ShaderMap
fml::RefPtr< Shader > GetShader(const std::string &shader_name, Dart_Handle shader_wrapper) const
struct _Dart_Handle * Dart_Handle
#define FLUTTER_GPU_EXPORT
FLUTTER_GPU_EXPORT Dart_Handle InternalFlutterGpu_ShaderLibrary_InitializeWithAsset(Dart_Handle wrapper, Dart_Handle asset_name)
FLUTTER_GPU_EXPORT Dart_Handle InternalFlutterGpu_ShaderLibrary_GetShader(flutter::gpu::ShaderLibrary *wrapper, Dart_Handle shader_name, Dart_Handle shader_wrapper)
DEF_SWITCHES_START aot vmservice shared library name