| 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/macros.h"
13 #include "flutter/fml/mapping.h"
14 #include "impeller/shader_archive/shader_archive_types.h"
15
16 namespace impeller {
17
18 class ShaderArchiveWriter {
19 public:
20 ShaderArchiveWriter();
21
22 ~ShaderArchiveWriter();
23
24 [[nodiscard]] bool AddShaderAtPath(const std::string& path);
25
26 [[nodiscard]] bool AddShader(ArchiveShaderType type,
27 std::string name,
28 std::shared_ptr<fml::Mapping> mapping);
29
30 std::shared_ptr<fml::Mapping> CreateMapping() const;
31
32 private:
33 struct ShaderDescription {
34 ArchiveShaderType type;
35 std::string name;
36 std::shared_ptr<fml::Mapping> mapping;
37 };
38
39 std::vector<ShaderDescription> shader_descriptions_;
40
41 ShaderArchiveWriter(const ShaderArchiveWriter&) = delete;
42
43 ShaderArchiveWriter& operator=(const ShaderArchiveWriter&) = delete;
44 };
45
46 } // namespace impeller
47
48 #endif // FLUTTER_IMPELLER_SHADER_ARCHIVE_SHADER_ARCHIVE_WRITER_H_
impeller::ShaderArchiveWriter::CreateMapping
std::shared_ptr< fml::Mapping > CreateMapping() const
Definition: shader_archive_writer.cc:98
impeller::ShaderArchiveWriter::ShaderArchiveWriter
ShaderArchiveWriter()
impeller::ArchiveShaderType
ArchiveShaderType
Definition: shader_archive_types.h:10
shader_archive_types.h
impeller::ShaderArchiveWriter::~ShaderArchiveWriter
~ShaderArchiveWriter()
impeller::ShaderArchiveWriter::AddShaderAtPath
bool AddShaderAtPath(const std::string &path)
Definition: shader_archive_writer.cc:31
impeller::ShaderArchiveWriter::AddShader
bool AddShader(ArchiveShaderType type, std::string name, std::shared_ptr< fml::Mapping > mapping)
Definition: shader_archive_writer.cc:74
impeller::ShaderArchiveWriter
Definition: shader_archive_writer.h:18
impeller
Definition: aiks_context.cc:10