| Flutter Impeller |

compiler.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_COMPILER_COMPILER_H_
6 #define FLUTTER_IMPELLER_COMPILER_COMPILER_H_
7
8 #include <initializer_list>
9 #include <sstream>
10 #include <string>
11
12 #include "flutter/fml/macros.h"
13 #include "flutter/fml/mapping.h"
14 #include "impeller/compiler/include_dir.h"
15 #include "impeller/compiler/reflector.h"
16 #include "impeller/compiler/source_options.h"
17 #include "impeller/compiler/spirv_compiler.h"
18 #include "impeller/compiler/types.h"
19 #include "spirv_msl.hpp"
20 #include "spirv_parser.hpp"
21
22 namespace impeller {
23 namespace compiler {
24
25 class Compiler {
26 public:
27 Compiler(const std::shared_ptr<const fml::Mapping>& source_mapping,
28 const SourceOptions& options,
29 Reflector::Options reflector_options);
30
31 ~Compiler();
32
33 bool IsValid() const;
34
35 std::shared_ptr<fml::Mapping> GetSPIRVAssembly() const;
36
37 std::shared_ptr<fml::Mapping> GetSLShaderSource() const;
38
39 std::string GetErrorMessages() const;
40
41 const std::vector<std::string>& GetIncludedFileNames() const;
42
43 std::unique_ptr<fml::Mapping> CreateDepfileContents(
44 std::initializer_list<std::string> targets) const;
45
46 const Reflector* GetReflector() const;
47
48 private:
49 SourceOptions options_;
50 std::shared_ptr<fml::Mapping> spirv_assembly_;
51 std::shared_ptr<fml::Mapping> sl_mapping_;
52 std::stringstream error_stream_;
53 std::unique_ptr<Reflector> reflector_;
54 std::vector<std::string> included_file_names_;
55 bool is_valid_ = false;
56
57 std::string GetSourcePrefix() const;
58
59 std::string GetDependencyNames(const std::string& separator) const;
60
61 Compiler(const Compiler&) = delete;
62
63 Compiler& operator=(const Compiler&) = delete;
64 };
65
66 } // namespace compiler
67 } // namespace impeller
68
69 #endif // FLUTTER_IMPELLER_COMPILER_COMPILER_H_
impeller::compiler::Compiler::~Compiler
~Compiler()
impeller::compiler::Compiler
Definition: compiler.h:25
impeller::compiler::Compiler::CreateDepfileContents
std::unique_ptr< fml::Mapping > CreateDepfileContents(std::initializer_list< std::string > targets) const
Definition: compiler.cc:483
impeller::compiler::SourceOptions
Definition: source_options.h:20
impeller::compiler::Compiler::Compiler
Compiler(const std::shared_ptr< const fml::Mapping > &source_mapping, const SourceOptions &options, Reflector::Options reflector_options)
Definition: compiler.cc:244
reflector.h
impeller::compiler::Compiler::GetErrorMessages
std::string GetErrorMessages() const
Definition: compiler.cc:455
impeller::compiler::Compiler::GetSPIRVAssembly
std::shared_ptr< fml::Mapping > GetSPIRVAssembly() const
Definition: compiler.cc:437
source_options.h
impeller::compiler::Reflector
Definition: reflector.h:146
impeller::compiler::Compiler::GetReflector
const Reflector * GetReflector() const
Definition: compiler.cc:498
impeller::compiler::Reflector::Options
Definition: reflector.h:148
spirv_compiler.h
impeller::compiler::Compiler::IsValid
bool IsValid() const
Definition: compiler.cc:445
impeller::compiler::Compiler::GetSLShaderSource
std::shared_ptr< fml::Mapping > GetSLShaderSource() const
Definition: compiler.cc:441
impeller::compiler::Compiler::GetIncludedFileNames
const std::vector< std::string > & GetIncludedFileNames() const
Definition: compiler.cc:459
impeller
Definition: aiks_blur_unittests.cc:20
types.h
include_dir.h