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 #pragma once
6 
7 #include <initializer_list>
8 #include <sstream>
9 #include <string>
10 
11 #include "flutter/fml/macros.h"
12 #include "flutter/fml/mapping.h"
18 #include "spirv_msl.hpp"
19 #include "spirv_parser.hpp"
20 
21 namespace impeller {
22 namespace compiler {
23 
24 class Compiler {
25  public:
26  Compiler(const std::shared_ptr<const fml::Mapping>& source_mapping,
27  const SourceOptions& options,
28  Reflector::Options reflector_options);
29 
30  ~Compiler();
31 
32  bool IsValid() const;
33 
34  std::shared_ptr<fml::Mapping> GetSPIRVAssembly() const;
35 
36  std::shared_ptr<fml::Mapping> GetSLShaderSource() const;
37 
38  std::string GetErrorMessages() const;
39 
40  const std::vector<std::string>& GetIncludedFileNames() const;
41 
42  std::unique_ptr<fml::Mapping> CreateDepfileContents(
43  std::initializer_list<std::string> targets) const;
44 
45  const Reflector* GetReflector() const;
46 
47  private:
48  SourceOptions options_;
49  std::shared_ptr<fml::Mapping> spirv_assembly_;
50  std::shared_ptr<fml::Mapping> sl_mapping_;
51  std::stringstream error_stream_;
52  std::unique_ptr<Reflector> reflector_;
53  std::vector<std::string> included_file_names_;
54  bool is_valid_ = false;
55 
56  std::string GetSourcePrefix() const;
57 
58  std::string GetDependencyNames(const std::string& separator) const;
59 
60  FML_DISALLOW_COPY_AND_ASSIGN(Compiler);
61 };
62 
63 } // namespace compiler
64 } // namespace impeller
impeller::compiler::Compiler::~Compiler
~Compiler()
impeller::compiler::Compiler
Definition: compiler.h:24
impeller::compiler::Compiler::CreateDepfileContents
std::unique_ptr< fml::Mapping > CreateDepfileContents(std::initializer_list< std::string > targets) const
Definition: compiler.cc:467
impeller::compiler::SourceOptions
Definition: source_options.h:19
impeller::compiler::Compiler::Compiler
Compiler(const std::shared_ptr< const fml::Mapping > &source_mapping, const SourceOptions &options, Reflector::Options reflector_options)
Definition: compiler.cc:234
reflector.h
impeller::compiler::Compiler::GetErrorMessages
std::string GetErrorMessages() const
Definition: compiler.cc:439
impeller::compiler::Compiler::GetSPIRVAssembly
std::shared_ptr< fml::Mapping > GetSPIRVAssembly() const
Definition: compiler.cc:421
source_options.h
impeller::compiler::Reflector
Definition: reflector.h:49
impeller::compiler::Compiler::GetReflector
const Reflector * GetReflector() const
Definition: compiler.cc:482
impeller::compiler::Reflector::Options
Definition: reflector.h:51
spirv_compiler.h
impeller::compiler::Compiler::IsValid
bool IsValid() const
Definition: compiler.cc:429
impeller::compiler::Compiler::GetSLShaderSource
std::shared_ptr< fml::Mapping > GetSLShaderSource() const
Definition: compiler.cc:425
impeller::compiler::Compiler::GetIncludedFileNames
const std::vector< std::string > & GetIncludedFileNames() const
Definition: compiler.cc:443
impeller
Definition: aiks_context.cc:10
types.h
include_dir.h