Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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"
19#include "spirv_msl.hpp"
20#include "spirv_parser.hpp"
21
22namespace impeller {
23namespace compiler {
24
25class Compiler {
26 public:
27 Compiler(const std::shared_ptr<const fml::Mapping>& source_mapping,
29 Reflector::Options reflector_options);
30
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_
const char * options
std::shared_ptr< fml::Mapping > GetSPIRVAssembly() const
Definition compiler.cc:437
const Reflector * GetReflector() const
Definition compiler.cc:498
const std::vector< std::string > & GetIncludedFileNames() const
Definition compiler.cc:459
std::unique_ptr< fml::Mapping > CreateDepfileContents(std::initializer_list< std::string > targets) const
Definition compiler.cc:483
std::shared_ptr< fml::Mapping > GetSLShaderSource() const
Definition compiler.cc:441
std::string GetErrorMessages() const
Definition compiler.cc:455