| Flutter Impeller |

shader_archive_writer.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_IMPELLER_SHADER_ARCHIVE_SHADER_ARCHIVE_WRITER_H_
6 #define FLUTTER_IMPELLER_SHADER_ARCHIVE_SHADER_ARCHIVE_WRITER_H_
7
8 #include <memory>
9 #include <string>
10 #include <vector>
11
12 #include "flutter/fml/mapping.h"
13 #include "impeller/shader_archive/shader_archive_types.h"
14
15 namespace impeller {
16
17 class ShaderArchiveWriter {
18 public:
19 ShaderArchiveWriter();
20
21 ~ShaderArchiveWriter();
22
23 [[nodiscard]] bool AddShaderAtPath(const std::string& path);
24
25 void SetEntryPointPrefix(std::string prefix);
26
27 [[nodiscard]] bool AddShader(ArchiveShaderType type,
28 std::string name,
29 std::shared_ptr<fml::Mapping> mapping);
30
31 std::shared_ptr<fml::Mapping> CreateMapping() const;
32
33 private:
34 struct ShaderDescription {
35 ArchiveShaderType type;
36 std::string name;
37 std::shared_ptr<fml::Mapping> mapping;
38 };
39
40 std::vector<ShaderDescription> shader_descriptions_;
41 std::string prefix_;
42
43 ShaderArchiveWriter(const ShaderArchiveWriter&) = delete;
44
45 ShaderArchiveWriter& operator=(const ShaderArchiveWriter&) = delete;
46 };
47
48 } // namespace impeller
49
50 #endif // FLUTTER_IMPELLER_SHADER_ARCHIVE_SHADER_ARCHIVE_WRITER_H_
type
GLenum type
Definition: blit_command_gles.cc:153
impeller::ShaderArchiveWriter
Definition: shader_archive_writer.h:17
impeller::ShaderArchiveWriter::AddShaderAtPath
bool AddShaderAtPath(const std::string &path)
Definition: shader_archive_writer.cc:40
impeller::ShaderArchiveWriter::AddShader
bool AddShader(ArchiveShaderType type, std::string name, std::shared_ptr< fml::Mapping > mapping)
Definition: shader_archive_writer.cc:87
impeller::ShaderArchiveWriter::CreateMapping
std::shared_ptr< fml::Mapping > CreateMapping() const
Definition: shader_archive_writer.cc:111
impeller::ShaderArchiveWriter::~ShaderArchiveWriter
~ShaderArchiveWriter()
impeller::ShaderArchiveWriter::SetEntryPointPrefix
void SetEntryPointPrefix(std::string prefix)
Definition: shader_archive_writer.cc:20
impeller::ShaderArchiveWriter::ShaderArchiveWriter
ShaderArchiveWriter()
impeller
Definition: allocation.cc:12
impeller::ArchiveShaderType
ArchiveShaderType
Definition: shader_archive_types.h:10
shader_archive_types.h